• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UPS XML Tracking problem

 
Douglas Kent
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Douglas Kent
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ulf - yes, the XML got filtered out: here's my XML being submitted:



Thanks in advance for the assist!
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem with ups shipping.
When I send request:

I take a respons : 20001General process failure
Can someone halp me?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf, I hope you help me, because I have no ideas what's to do.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic