GeeCON Prague 2014*
The moose likes Other Java Products and Servers and the fly likes UPS XML Tracking problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "UPS XML Tracking problem" Watch "UPS XML Tracking problem" New topic
Author

UPS XML Tracking problem

Douglas Kent
Ranch Hand

Joined: Oct 06, 2000
Posts: 171
Hello,
Am attempting to use UPS XML tracking. I'm all set up with login, password, etc, going into the test site at wwwcie.ups.com. I've communicated with their tech support people, and they say my access XML and tracking request XML documents are correct. I can hit the server and get a reply (see below). I have tried URL-encoding the submission and leaving it unencoded. No matter what, get the same reply, here:

The word from UPS support is that it's some error on my side, which I can accept, of course, but am out of ideas...Here's my code:
Douglas Kent
Ranch Hand

Joined: Oct 06, 2000
Posts: 171
Looking at my post, I see the XML reply from UPS did not completely show, prob due to the long line; here it is again:
Douglas Kent
Ranch Hand

Joined: Oct 06, 2000
Posts: 171
I see the server filtered out the XML tags:
ResponseStatusCode: 0
ResponseStatusDescription: Failure
ErrorSeverity: Transient
ErrorCode: 20001
ErrorDescription: General process failure
Douglas Kent
Ranch Hand

Joined: Oct 06, 2000
Posts: 171
I had read a previous post earlier this year where someone was starting way back from where I am currently. Ulf Dittmer, moderator at the time, seemed to have quite a bit of knowledge of the topic....
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
And here I am

Looking at what you're sending, it seems that it is not valid XML at all. Unless the UPS Tracking Kit has changed since last I used it, all requests and responses must be proper XML documents. The following are examples I used back then:


As an aside, if you post XML in these forums, you need to replace all "<" by "&lt;" and ">" by "&gt;", otherwise the software is going to swallow it.

Update after more reading: Or was it valid XML, and all tags in your Java code were removed as well?
[ July 17, 2007: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Douglas Kent
Ranch Hand

Joined: Oct 06, 2000
Posts: 171
Hello Ulf - yes, the XML got filtered out: here's my XML being submitted:



Thanks in advance for the assist!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
Try removing the Doctype declarations.

Also, line endings in HTTP headers consist of a CR/LF combination, and not just of a LF.
Douglas Kent
Ranch Hand

Joined: Oct 06, 2000
Posts: 171
Thanks much. Removing the DOCTYPE declarations did the trick. I read in the HTTP standard that servers are required to accept just a \n, so went with that, working now.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
That's good to hear.

Strange about the HTTP linebreaks, though. The HTTP 1.1 spec states "a bare CR or LF MUST NOT be substituted for CRLF within any of the HTTP control structures (such as header fields and multipart boundaries)." in section 3.7.1. It does talk about either CR or LF being acceptable linebreaks in the body, but not the header - which section are you referring to?
Douglas Kent
Ranch Hand

Joined: Oct 06, 2000
Posts: 171
I found the reference - not hte spec itself, but a description - here:
J Marshall
Seems the author finds some wiggle room...


I have been having problems communicating with FedEx XML Tracking service. Do you have any experience with FedEx?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
I have been having problems communicating with FedEx XML Tracking service. Do you have any experience with FedEx?[/QB]


No. UPS is more prevalent here, and it solved our needs.
[ July 18, 2007: Message edited by: Ulf Dittmer ]
Alexey Rak
Greenhorn

Joined: Apr 23, 2009
Posts: 4
I have a problem with ups shipping.
When I send request:

I take a respons : 20001General process failure
Can someone halp me?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
What are the backslashes doing there - that's not valid XML.

Also, in line 18, it looks as if something didn't get processed correctly before sending.
Alexey Rak
Greenhorn

Joined: Apr 23, 2009
Posts: 4
It's a PHP code. Request sending to server looks:
<?xml version = '1.0' encoding = 'UTF-8'?>

<AccessRequest xml:lang='en-US'>
<AccessLicenseNumber>DBA6AB3C96113D48</AccessLicenseNumber>
<UserId>adolphdupre</UserId>
<Password>michael1</Password>
</AccessRequest>
<?xml version = '1.0' encoding = 'UTF-8'?>

<ShipmentAcceptRequest>
<Request>
<TransactionReference>
<CustomerContext>guidlikesubstance</CustomerContext>
<XpciVersion>1.0001</XpciVersion>

</TransactionReference>
<RequestAction>ShipAccept</RequestAction>
</Request>
<ShipmentDigest>xxxxxxxxxxxxxxxxxxxxx</ShipmentDigest>
</ShipmentAcceptRequest>

ShipmentDigest is return correct.
Alexey Rak
Greenhorn

Joined: Apr 23, 2009
Posts: 4
This is the full respons from server:
<ShipmentConfirmResponse>
<Response>
<TransactionReference>
<CustomerContext>guidlikesubstance</CustomerContext>
<XpciVersion>1.0001</XpciVersion>
</TransactionReference>
<ResponseStatusCode>0</ResponseStatusCode>
<ResponseStatusDescription>Failure</ResponseStatusDescription>
<Error>
<ErrorSeverity>Transient</ErrorSeverity>
<ErrorCode>20001</ErrorCode>
<ErrorDescription>General process failure</ErrorDescription>
</Error>
</Response>
</ShipmentConfirmResponse>
I hope it's help you to find the ansver
Alexey Rak
Greenhorn

Joined: Apr 23, 2009
Posts: 4
Hi Ulf, I hope you help me, because I have no ideas what's to do.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
I haven't used "ShipmentAcceptRequest", so I can't speculate what might be going wrong. Make sure that the request is correct (look at the examples, and read the user documentation). If that doesn't help, check the UPS site for support forums/newsgroups/mailing lists.
 
GeeCON Prague 2014
 
subject: UPS XML Tracking problem