File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Java Products and Servers and the fly likes UPS Online Tools Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "UPS Online Tools" Watch "UPS Online Tools" New topic
Author

UPS Online Tools

Rajesh Rajaram
Ranch Hand

Joined: Aug 20, 2002
Posts: 63
Hello All,


Has anyone integrated UPS online tools with their website or company website.

Need some technical help on it.

Thanks


Rajesh Rajaram
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Yes. What problem are you facing?


Ping & DNS - updated with new look and Ping home screen widget
Rajesh Rajaram
Ranch Hand

Joined: Aug 20, 2002
Posts: 63
What ever tools UPS suggesting are not there in the web. can you point me sample code to implement the ups tools?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
The SDK came with a number of examples, from which it was quite simple to put together a client that accesses the UPS web services. You need to register on the web site before you can download the SDK. And, of course, you need a UPS customer ID before you can use them.
Rajesh Rajaram
Ranch Hand

Joined: Aug 20, 2002
Posts: 63
Thanks Ulf, the tool i am working is Rates and Selection.Its not calling any webservice instead its sending a XML documents using XMLRequest and XMLResponse.

I have registered and i am having the Developer key and Code to access the UPS system.

They have developed in JDK 1.1 and 1.2 these versions are no longer supported by Sun.

they asking to create URLConnection and invoke HTTPS from a client java program. which where i am having problem. let me know if you have come across a similar situation.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Its not calling any webservice instead its sending a XML documents using XMLRequest and XMLResponse.

Well, that makes it a web service, too, doesn't it?

They have developed in JDK 1.1 and 1.2 these versions are no longer supported by Sun.

If the code works in those versions, then it should also work in more current JDKs. The communication is in any case independent of the JDK version, so that should not cause any problems at all.

they asking to create URLConnection and invoke HTTPS from a client java program. which where i am having problem. let me know if you have come across a similar situation.

Yes, I've done that, without problems. Tells us in detail what the problem is, and we'll try to help.
Praveen Reddy
Ranch Hand

Joined: Jul 12, 2006
Posts: 51
Me facing with same problem please help me with code if you have any ? its very urgent
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Me facing with same problem

And what problem is that? The original poster never told us what -exactly- the problem is.
[ March 13, 2007: Message edited by: Ulf Dittmer ]
Praveen Reddy
Ranch Hand

Joined: Jul 12, 2006
Posts: 51
the problem is ups has given some documentation it has not given any sample code the states as follows

1) Open a secure secure URL connection using the connection address for the
interface to be invoked.
2. Create an XML request message. All messages must be XPCI-compliant.
3. Send the XML request message to the tool. To send a request message to a tool, an application writes a stream of data to the tool via secure URL connection. The data stream must be in the form of an HTTP POST request message.
4. Receive the XML response message from the tool. To read a response from a tool, an application reads the response in XML format via a secure TCP/IP socket or secure URL connection.
5. Parse the XML response message to retrieve data.
6. Identify and handle error conditions.

Please help me if you can provide any sample code. for me its very difficult to write a code on my own

Thanks in advance
Praveen Reddy
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Do you have the UPS XML Tracking Dev Kit? It has sample code that does just this. Look for "UPS Internet Tools" or "UPS Online Tools" on the UPS web site.
Praveen Reddy
Ranch Hand

Joined: Jul 12, 2006
Posts: 51
No i Dont have UPS XML tracking Developer kit, My project Manager just given me a 1) Acess Key 2) Developer Key 3) User Id and pwd

and a manual(.pdf format) which describes Product Overview, General Programing Information (it doesn't have any code) and Security Elements.

Please Suggest Me Something (if you have any sample code please give me)
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Well then download it. You need to register on the UPS web site, although the username/password you have may be the ones for the web site.

We're willing to help, but you need to show that you are making some effort. Just saying "please send me the code" is not going to do it if you can't even be bothered to download a dev kit that has explanations, sample code, technical specifications and other stuff you'll need to get this done.
Praveen Reddy
Ranch Hand

Joined: Jul 12, 2006
Posts: 51
i am very Sorry to be frank i dont know there is an sdk for it i taught we have to link up with the server with the URL connection all this think we have to manage with the java code i have downloaded the sdk there i can see sample xml responce and java code.

Thanks for the help. if i hurt you i am very sorry.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
No need to be sorry, everything's cool.

Let us know how you make out with the sample code.
Praveen Reddy
Ranch Hand

Joined: Jul 12, 2006
Posts: 51
Thanks Ulf Dittmer & Java Ranch For helping me

I have another question please help me out

i have a form where i need to enter address(city,State zip) ups online tool will verify it here for doing this process i have written a servlet by seeing the sample code of UPS tool. The code is working fine i am getting the response from ups. will there be any problem here if i change class file to servlet? i have changed to servlet because i have to retrive values from form.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Why should that be a problem?
Praveen Reddy
Ranch Hand

Joined: Jul 12, 2006
Posts: 51
Hi Java Ranch

I have a Question, in UPS Online Tools i am getting response from server and that response i have stored in .xml file now i have to read that response, Should i write a code by ussing IO Streams to read that file(is there any ready code for reading?) or is there any other way to read xml response. if so please tell me.

Thanks in advance!!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
The natural way to read XML files would be to use an XML parser. I've used the XOM library, but any XML API will do (SAX, DOM, dom4j, JDOM, ...)

Using straight file I/O and trying to find the interesting parts of the XML in it is bound to cause problems.
Praveen Reddy
Ranch Hand

Joined: Jul 12, 2006
Posts: 51
Thanks Ulf Dittmer i have read the XML parser now i can read xml tag and get date.

when i upload my project to server and tried to connect to UPS the following error message occours as Response

<?xml version="1.0"?><TrackResponse><Response><TransactionReference> <CustomerContext>Customer Data</CustomerContext><XpciVersion>1.0001 </XpciVersion></TransactionReference><ResponseStatusCode>0</ResponseStatusCod<br /> e><ResponseStatusDescription>Failure</ResponseStatusDescription><Error><ErrorSev<br /> erity>Hard</ErrorSeverity><ErrorCode>10002</ErrorCode><ErrorDescription>The XML document is well formed but the document is not Valid </ErrorDescription><ErrorLocation><ErrorLocationElementName>TrackRequest</ErrorLocationElementName></ErrorL<br /> ocation></Error></Response></TrackResponse>

My xml Request is

<?xml version="1.0"?>
<AddressValidationRequest xml:lang="en-US">
<Request> <TransactionReference><CustomerContext>Customer Data </CustomerContext> <XpciVersion>1.0001</XpciVersion>
</TransactionReference>RequestAction>AV</RequestAction></Request>
<Address><City>MIAMI</City><StateProvinceCode>FL</StateProvinceCode>
</Address></AddressValidationRequest>

Can you please Suggest what might be the possible error.

This is My 4th day to work with UPS Online tool do you think am i taking more time to connect this tool or this will happen for the developer who is doing for the first time(four days include reading the documentation understanding and and trying to connect)please give me suggestion on this
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
I think the XML you posted got corrupted, because what I can see is not even valid XML; so it's impossible to say what might be the problem.

If I remember correctly it took me maybe two days to integrate UPS Tracking integrated into a web app we used. Make sure that the XML you're sending conforms to the documentation.
Praveen Reddy
Ranch Hand

Joined: Jul 12, 2006
Posts: 51
yes my previous post is corrupted,

Response which i have got from UPS online tool

<?xml version="1.0"?>
<TrackResponse><Response>
<TransactionReference>
<CustomerContext>Customer Data</CustomerContext>
<XpciVersion>1.0001</XpciVersion>
</TransactionReference>
<ResponseStatusCode>0</ResponseStatusCode>
<ResponseStatusDescription>Failure</ResponseStatusDescription>
<Error><ErrorSeverity>Hard</ErrorSeverity><ErrorCode>10002</ErrorCode>
<ErrorDescription>
The XMLdocument is well formed but the document is not valid </ErrorDescription><ErrorLocation>
<ErrorLocationElementName>TrackRequest</ErrorLocationElementName>
</ErrorLocation></Error></Response></TrackResponse>


Request which i have send
<?xml version="1.0"?>
<AddressValidationRequest xml:lang="en-US">
<Request>
<TransactionReference>
<CustomerContext>Customer Data</CustomerContext>
<XpciVersion>1.0001</XpciVersion>
</TransactionReference>
<RequestAction>AV</RequestAction>
</Request>
<Address>
<City>MIAMI</City>
<StateProvinceCode>FL</StateProvinceCode>
</Address>
</AddressValidationRequest>


Can you please Suggest what might be the possible error.

Thanks in advance
Praveen Reddy
Ranch Hand

Joined: Jul 12, 2006
Posts: 51
i am sorry once again my post is corrupted, i'm unable to post it even though i have documented it correctly.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
You probably need to replace "<" by "&lt;" and ">" by "&gt;"
Praveen Reddy
Ranch Hand

Joined: Jul 12, 2006
Posts: 51
i have traced my server output the following error message occurs please suggest me

Request = <?xml version="1.0"?><AddressValidationRequest xml:l
ang="en-US"><Request><TransactionReference><CustomerContext></CustomerContext>
<XpciVersion>1.0001</XpciVersion></TransactionReference><RequestAction>AV</Request
Action></Request><Address><City>Foster City</City><StateProvinceCode>CA</StatePr
ovinceCode></Address></AddressValidationRequest>


Response = <?xml version="1.0"?><TrackResponse><Response><TransactionReference><
XpciVersion>1.0001</XpciVersion></TransactionReference><ResponseStatusCode>0</Re
sponseStatusCode><ResponseStatusDescription>Failure</ResponseStatusDescription><
Error><ErrorSeverity>Hard</ErrorSeverity><ErrorCode>10002</ErrorCode><ErrorDescr
iption>The XML document is well formed but the document is not valid</ErrorDescr
iption><ErrorLocation><ErrorLocationElementName>TrackRequest</ErrorLocationEleme
ntName></ErrorLocation></Error></Response></TrackResponse>

XMLTransmitter::contactService(String, String)********************************
Finished Track Tue Mar 20 16:29:42 GMT+05:30 2007 *******************************

Thanks in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
You'll need to consult the documentation that came with the dev kit as to what a proper address validation request looks like. The error message mentions that the error concerns something called "TrackRequest"; that may be a clue where to start looking.
Praveen Reddy
Ranch Hand

Joined: Jul 12, 2006
Posts: 51
Ulf Dittmer Thanks a lot for your support now i can able to integrate ups tool its working fine.

Once again Thankyou vary much..

Thanks & Regards
Praveen Reddy
Praveen Reddy
Ranch Hand

Joined: Jul 12, 2006
Posts: 51
which hosting server support paymentech each and every server supports it or is there any specified one and i want the server to be supportive of jdk1.5, mysql 5.0, tomcat 5.5


Thanks in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
This question has nothing to do with UPS Online Tools. Please start a new thread in an appropriate forum.
am tezas
Greenhorn

Joined: Jul 30, 2009
Posts: 1
Praveen Reddy wrote:Ulf Dittmer Thanks a lot for your support now i can able to integrate ups tool its working fine.

Once again Thankyou vary much..

Thanks & Regards
Praveen Reddy


Hey Praveen, how was the issue resolved? I am stuck with the same error:1002 0FailureHard10002The XML document is well formed but the document is not valid
Dadasaheb Honde
Greenhorn

Joined: Feb 10, 2010
Posts: 1
am tezas wrote:
Praveen Reddy wrote:Ulf Dittmer Thanks a lot for your support now i can able to integrate ups tool its working fine.

Once again Thankyou vary much..

Thanks & Regards
Praveen Reddy


Hey Praveen, how was the issue resolved? I am stuck with the same error:1002 0FailureHard10002The XML document is well formed but the document is not valid


------------------
It seems the webservice end point is incorrect. you may need to make sure that you are accessing correct Web Service for the respective API.
This error usually occurs when the expected xml elements are not found in the request. So if different webservice is being pointed by mistake this will be a common error.
 
jQuery in Action, 2nd edition
 
subject: UPS Online Tools
 
Similar Threads
Reg Hosting Server
UPS Online tools using java
UPS Online tools using java
USPS web service query
WA #1.....word association