UPS Quantum View

Posted by davidhauschild on 30-Sep-2015 12:53

Does anybody have an OpenEdge solution for working with the UPS Quantum View API?  Currently, the Quantum View API is not supported as a web service (wsdl), only XML. 

Thanks in advance.

All Replies

Posted by Garry Hall on 01-Oct-2015 21:59

I have not heard of any OpenEdge applications using the UPS Quantum View API. Judging by the lack of response, neither have any of the other community members. Sorry we could not be of more assistance.

Posted by Brian K. Maher on 02-Oct-2015 06:23

I know other customers use this API as in the past I have had support cases from them.
 
As to what flavor they have used to communicate with UPS, I don't remember.
 

Posted by Brian K. Maher on 02-Oct-2015 07:47

David,

Please open a case with Tech Support and provide us with the different ways UPS has given you to call them.  We can look at those and help you.

Brian

Posted by christian.bryan@capita.co.uk on 02-Oct-2015 08:38

If you are just looking for an example program to post some XML to a web services give the below a try:

/* xml_post.p

CJB01 - 06/09/2012 - Allow for SSL
*/
DEFINE INPUT PARAM ip-vcWebHost AS CHARACTER INITIAL "localhost" NO-UNDO.
DEFINE INPUT PARAM ip-vcWebPort AS CHARACTER INITIAL "80" NO-UNDO.
DEFINE INPUT PARAM ip-vcWSAgent AS CHARACTER INITIAL "/scripts/cgiip.exe/WService=openaccess-v9-oe/webserviceHGLagan.p" NO-UNDO.
DEFINE INPUT PARAM ip-XMLrequest AS CHAR NO-UNDO.
DEFINE OUTPUT PARAM op-response AS LONGCHAR NO-UNDO.
DEFINE OUTPUT PARAM op-error AS CHAR NO-UNDO.


/* An easy test on the WebSpeed object side (xmlagent.p ) is */
/* to check whether the WEB-CONTEXT:IS-XML is TRUE and */
/* WEB-CONTEXT:X-DOCUMENT is a valid handle. */
DEFINE VARIABLE vhWebSocket AS HANDLE NO-UNDO.

CREATE SOCKET vhWebSocket.


IF ip-vcWebPort = "443" THEN vhWebSocket:CONNECT('-H ' + ip-vcWebHost + ' -S ' + ip-vcWebPort + ' -ssl' ) NO-ERROR.
ELSE vhWebSocket:CONNECT('-H ' + ip-vcWebHost + ' -S ' + ip-vcWebPort) NO-ERROR.

IF vhWebSocket:CONNECTED() = FALSE THEN DO:

MESSAGE "Error - " ERROR-STATUS:GET-MESSAGE(1).
/* error connecting to the Web Server */
ASSIGN op-Error = "Connection to host failed Error - " + ERROR-STATUS:GET-MESSAGE(1).
RETURN.
END.

vhWebSocket:SET-READ-RESPONSE-PROCEDURE('getWebServerResponce').
RUN PostRequest(INPUT ip-XMLrequest) .
WAIT-FOR READ-RESPONSE OF vhWebSocket.
vhWebSocket:DISCONNECT() NO-ERROR.
DELETE OBJECT vhWebSocket.

/* Responsible for reading server response */
PROCEDURE getWebServerResponce:
DEFINE VARIABLE vcWebResp AS LONGCHAR NO-UNDO.
DEFINE VARIABLE lSuccess AS LOGICAL.
DEFINE VARIABLE mResponse AS MEMPTR.

IF SELF:CONNECTED() = FALSE THEN RETURN.

lSuccess = TRUE.
DO WHILE lSuccess AND ERROR-STATUS:GET-MESSAGE(1) EQ '' :
SET-SIZE(mResponse) = 1.
SET-BYTE-ORDER(mResponse) = BIG-ENDIAN.
SELF:READ(mResponse,1,1,1).
vcWebResp = vcWebResp + GET-STRING(mResponse,1).
IF SELF:CONNECTED() = FALSE THEN LEAVE.
END.

/* just to see what is coming back */
/*
OUTPUT TO value(os-getenv("temp") + "\xmlsend.log").

put unformatted "BEGIN: " STRING ( TIME , "hh:mm:ss" ) SKIP.
put unformatted string(vcWebResp) SKIP.
put unformatted "END: " STRING ( TIME , "hh:mm:ss" ) SKIP.

output close.
*/

ASSIGN op-Response = vcWebResp.

END PROCEDURE.

/* make a request and post the xml document */
PROCEDURE PostRequest:
DEFINE INPUT PARAM ip-vcXMLText AS CHARACTER NO-UNDO.

DEF VAR viXMLLength AS INTEGER.
DEF VAR vcRequest AS CHARACTER.
DEF VAR viRequest AS INTEGER.
DEF VAR viMsg AS INTEGER.
DEF VAR mRequest AS MEMPTR.
DEF VAR lSuccess AS LOGICAL.

ASSIGN viXMLLength = LENGTH ( ip-vcXMLText )
vcRequest = 'POST ' + ip-vcWSAgent
+ ' HTTP/1.0~n'
+ 'Content-Type: text/xml~n' /* post XML DOC */
+ 'Host: ' + ip-vcWebHost + '~n'
+ 'Content-Length: ' + STRING(viXMLLength) + '~n'
+ 'KeepAlive: false' + '~n' /* CJB99 */
+ 'Accept: text/html~n'

+ '~n'
viRequest = LENGTH ( vcRequest )
viMsg = viRequest + viXMLLength + 1.


SET-SIZE(mRequest) = 0.
SET-SIZE(mRequest) = viMsg.
SET-BYTE-ORDER(mRequest) = BIG-ENDIAN.

PUT-STRING(mRequest,1) = vcRequest + ip-vcXMLText.

vhWebSocket:WRITE(mRequest,1,viMsg) NO-ERROR.

IF ERROR-STATUS:ERROR THEN DO:
/* error connecting to the Web Server */
ASSIGN op-Error = ERROR-STATUS:GET-MESSAGE(1).
END.
END PROCEDURE.

This thread is closed