[jdom-interest] Problems Creating a Document

Hunter Hillegas timebomb at west.net
Thu Nov 29 08:50:30 PST 2001


upsUrl = new URL("https://wwwcie.ups.com/ups.app/xml/Rate");
urlCon = (HttpURLConnection)upsUrl.openConnection();

It is data from a remote https URL.

> From: "Gu Xueying (Shinnie Gu)" <Shinnie.Gu at iuniverse.com.cn>
> Date: Thu, 29 Nov 2001 16:46:48 +0800
> To: Hunter Hillegas <timebomb at west.net>
> Subject: RE: [jdom-interest] Problems Creating a Document
> 
> Can you tell me what's urlCon in your codes?
> 
> -----Original Message-----
> From: Hunter Hillegas [mailto:timebomb at west.net]
> Sent: 2001年11月29日 16:05
> To: jdom-interest at jdom.org
> Subject: [jdom-interest] Problems Creating a Document
> 
> 
> Hello. I am somewhat new to JDOM. I have used it several times for small
> projects but now I am trying to use it in a J2EE project and I'm having some
> trouble...
> 
> Basically I am getting this exception:
> 
> org.jdom.JDOMException: Error on line 1: Document root element is missing.
> 
> This is how I'm setting up my JDOM session:
> 
> InputStream in = urlCon.getInputStream();
> SAXBuilder builder = new SAXBuilder();
> Document doc = builder.build(in);
> Element docRoot = doc.getRootElement(); //get the root
> 
> I have verified that the InputStream does seem to have access to valid XML
> that looks like this:
> 
> <?xml version="1.0"?>
> <RatingServiceSelectionResponse>
> <Response>
>   <TransactionReference>
>     <CustomerContext>Rating and Service</CustomerContext>
>     <XpciVersion>1.0001</XpciVersion>
>   </TransactionReference>
>   <ResponseStatusCode>1</ResponseStatusCode>
>   <ResponseStatusDescription>Success</ResponseStatusDescription>
> </Response>
> <RatedShipment>
>   <Service>
>     <Code>01</Code>
>   </Service>
>   <BillingWeight>
>     <UnitOfMeasurement>
>       <Code>LBS</Code>
>     </UnitOfMeasurement>
>     <Weight>2.0</Weight>
>   </BillingWeight>
> ... There is a lot more...
> 
> I'm trying to use this to communicate with UPS to get shipping info...
> 
> So, I have pretty much no idea how to debug this... Any suggestions are
> appreciated.
> 
> Hunter
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
> t.com
> 




More information about the jdom-interest mailing list