Question UPS Tracking API integration with ABL ?

LarryD

Active Member
Has anyone successfully created web services ABL code that works with the UPS Tracking API? I'm asking for any hints or ideas as to what is or is not going on or if somehow I need to do some hacking within the wsdl they provided. (I can include the wsdl here if it would help).

I was able to easily get FedEx tracking API working just fine using the same coding as below, but UPS has me baffled. No matter what I've tried, no XML or connection errors occur and all I get is:
Error receiving Web Service Response: No message received. (11773)

The two major differences between the two are that UPS uses SSL3 and Fedex is standard http, and the odd XML structure UPS requires for the login and tracking info being concatenated instead of just including the login within the normal structures.

OE10.2B08 (soon to be upgraded to 11.3.3)
Linux 64 bit
Character

Here is what I've done to date:

I've downloaded the WSDL and all the assorted documentation, ran bprowsdldoc to get the connection and IP info. We have UPS access keys and login info.
I've imported all the certs from the web site that were provided as well as the one in the documentation.

Here is the XML (and yes, while not standard this is how it's supposed to be formatted straight from the UPS samples and what I've seen on the web):
Code:
<?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
  <AccessLicenseNumber>license number</AccessLicenseNumber>
  <UserId>user</UserId>
  <Password>pwd</Password>
</AccessRequest>
<?xml version="1.0"?>
<TrackRequest xml:lang="en-US">
  <Request>
    <TransactionReference>
      <CustomerContext>our context</CustomerContext>
       <XpciVersion>1.0</XpciVersion>
    </TransactionReference>
    <RequestAction>Track</RequestAction>
    <RequestOption>activity</RequestOption>
  </Request>
  <TrackingNumber>trackingnumber</TrackingNumber>
</TrackRequest>

And here are the relevant snippets of code:
Code:
def var TrackRequest AS LONGCHAR NO-UNDO.
def var TrackReply AS LONGCHAR NO-UNDO.
def var hWebService AS HANDLE NO-UNDO.

def var hTrackPortType AS HANDLE NO-UNDO.

 hWebService:CONNECT("-WSDL '/usr/UPS/Track.wsdl'" ).

RUN TrackPortType SET hTrackPortType ON hWebService NO-ERROR.

IF ERROR-STATUS:ERROR
THEN DO:
        MESSAGE "Connect failed!" VIEW-AS ALERT-BOX.
        DO i = 1 TO ERROR-STATUS:NUM-MESSAGES:
            MESSAGE ERROR-STATUS:GET-MESSAGE(i) VIEW-AS ALERT-BOX.
        END.

        delete object hTrackPortType.
        delete object hWebService.
        RETURN.
END.

... code to set TrackRequest from the XML above...

RUN ProcessTrack IN hTrackPortType(INPUT TrackRequest, OUTPUT TrackReply).
IF ERROR-STATUS:ERROR
THEN DO:
        MESSAGE "ProcessTrack failed!" VIEW-AS ALERT-BOX.
        DO i = 1 TO ERROR-STATUS:NUM-MESSAGES:
            MESSAGE ERROR-STATUS:GET-MESSAGE(i) VIEW-AS ALERT-BOX.
        END.

        delete object hTrackPortType.
        delete object hWebService.
        RETURN.
END.
.... do stuff with reply ...

delete object hTrackPortType.

hWebService:DISCONNECT().

delete object hWebService.


PROCEDURE ProcessTrack:
  DEFINE INPUT PARAMETER Body1 AS LONGCHAR NO-UNDO.
  DEFINE OUTPUT PARAMETER Body2 AS LONGCHAR NO-UNDO.
END PROCEDURE.
 
Top