Question
· Jan 5, 2018

UPS - SOAP WebServices Not Working

Hi all,

I have started using the UPS in my application for shipment and cancellation.

I have the WSDL from the UPS.

I have imported the WSDL via Studio->Tools->addins and finish the process to get the Package implemeted in my studio.

Now the SOAP method contains a URL which is for their live system so i manually changed the URL with their Testing URL.

They are also providing the sample shipment numbers which we can use to test the cancellation process.

I am trying that shipment number to void(cancel) the shipment by call the method.

And i am facing the error as below,

<ZSOAP>zInvokeClient+205^%SOAP.WebClient.1

and below as detailed, 

ERROR #6248: SOAP response is a SOAP fault: faultcode=Client
faultstring=An exception has been raised as a result of client data.
faultactor=
detail=<err:Errors xmlns:err="http://www.ups.com/schema/xpci/1.0/error"><err:ErrorDetail><err:Severity>Hard</err:Severity><err:PrimaryErrorCode><err:Code>10002</err:Code><err:Description>The XML document is well formed but the document is not valid</err:Description><err:Digest>Authentication Header not provided.</err:Digest></err:PrimaryErrorCode></err:ErrorDetail></err:Errors>

 

I dont know much about webservices and neither did i made any manually coding for what i am using.

I dont know where to give the Authentication header. If anyone is familiar with UPS integration please help me.

 

Thanks in advance

Regards,

Arya

Discussion (3)0
Log in or sign up to continue

Google implies that your request is not complete.

Generally, when debugging web services you should follow these steps:

  1. Have a way to send valid requests (i.e. SoapUI)
  2. Send request via Caché/Ensemble
  3. Compare (DiffDog, etc) requests from 1 and 2, here you need to:
    • Modify valid request till it fails
    • Modify invalid request  till it succeeds

Also, don't forget to send new request after each modification. Web services often have GUID/ID by which they identify incoming requests. If incoming request has the same identifier they don't execute it again, but just return cached result. Identifier can be a header or inside message body.

Hello-

First, admittedly I'm not sure the cause to your error as I do not have access to your generated SOAP client classes, your SSL Configuration, etc.

That said, I was able to implement the UPS API for the Tracking API and was able to execute without issue.  To get it to work you will need to do the following.

1.   Create a SSL client configuration (test it against the UPS server) to be used for SSL encryption.  it does not appear that UPS provides a non encrypted connection for testing.

2.   Obtain all of the wsdl files (including the additional xsd documentts that define the different types that UPS API supports. 

3.  Use the SOAP wizard to create a client.  I used the package UPS.   In the wizard, on the Step 3 page, select the option "Use unwrapped message format for document style web methods "  This is critical because the SOAP wizard will not create the correct client without it checked.

Once created, the following class method can be used to test your service.  I just added this to my SOAP client class UPS.TrackPort

ClassMethod Test(InquiryNumber As %String) As UPS.common.ResponseType
{
    ; Setup Web Service Client and Security
    s ws=##class(UPS.TrackPort).%New()
     s ws.SSLConfiguration="SSLClient"
     s sechdr=##class(UPS.upss.UPSSecurity).%New()
     s usertoken=##class(UPS.upss.UsernameToken).%New()
     s usertoken.Username="myusername"
     s usertoken.Password="mypassword"
     s sechdr.UsernameToken=usertoken
     s acctoken=##class(UPS.upss.ServiceAccessToken).%New()
     s acctoken.AccessLicenseNumber="myaccessLicenseNumber"
     s sechdr.ServiceAccessToken=acctoken
     do ws.HeadersOut.SetAt(sechdr,"UPSSecurity")
    ;
    ; Setup Request
    set trakRequest=##class(UPS.trk.TrackRequest).%New()
    set trakRequest.Request=##class(UPS.common.RequestType).%New()
    do trakRequest.Request.RequestOption.Insert(1)
    set transactionReference=##class(UPS.common.TransactionReferenceType).%New()
    set transactionReference.CustomerContext="My Ensemble Process "_$j
    set trakRequest.Request.TransactionReference=transactionReference
    set trakRequest.InquiryNumber=InquiryNumber
    ;
    quit ws.ProcessTrack(trakRequest)
}

Once this is done, you can test as follows

USER>s resp=##class(UPS.TrackPort).Test("1Z12345E0205271688")
 
USER>w resp
20@UPS.trk.TrackResponse
USER>zw resp
resp=<OBJECT REFERENCE>[20@UPS.trk.TrackResponse]
+----------------- general information ---------------
|      oref value: 20
|      class name: UPS.trk.TrackResponse
| reference count: 2
+----------------- attribute values ------------------
|           (none)
+----------------- swizzled references ---------------
|       i%Disclaimer = ""
|    i%Disclaimer(1) = "You are using UPS tracking service on customer integration test environment, please switch to UPS production environment once you finish the test. The URL is https://onlinetools.ups.com/webservices/Track"
|       r%Disclaimer = "49@%Collection.ListOfDT"  <Set>
|         i%Response = ""
|         r%Response = "21@UPS.common.ResponseType"
|         i%Shipment = ""
|      i%Shipment(1) = ""
|         r%Shipment = "48@%Collection.ListOfObj"
|      r%Shipment(1) = "24@UPS.trk.ShipmentType"
+-----------------------------------------------------

Hope this helps