469,271 Members | 1,731 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

UPS XML Module Erroe..1001

123 100+
Hi all ,
That is the XML part for the UPS shipping module , which i have made..
IThe code is ,

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <AccessRequest xml:lang="en-US">
  3.    <AccessLicenseNumber>{$this->_access_key}</AccessLicenseNumber>
  4.    <UserId>{$this->_username}</UserId>
  5.    <Password>{$this->_password}</Password>
  6. </AccessRequest>
  7. <?xml version="1.0"?>
  8. <RatingServiceSelectionRequest xml:lang="en-US">
  9.    <Request>
  10.       <TransactionReference>
  11.          <CustomerContext></CustomerContext>
  12.          <XpciVersion>1.0001</XpciVersion>
  13.       </TransactionReference>
  14.       <RequestAction>{$this->_request_option}</RequestAction>
  15.       <RequestOption>{$this->_request_option}</RequestOption>
  16.    </Request>
  17.    <PickupType>
  18.       <Code>01</Code>
  19.    </PickupType>
  20.    <Shipment>
  21.       <Shipper>
  22.         <shipperNumber>66V7R5</shipperNumber>
  23.         <Adress>
  24.         <City></City>
  25.         <StateProvinceCode><StateProvinceCode>
  26.          <PostalCode></PostalCode>
  27.          <CountryCode>US<CountryCode>
  28.          </Address>
  29.       </Shipper>
  30.       <ShipTo>
  31.          <Address>
  32.             <StateProvinceCode></StateProvinceCode>
  33.             <PostalCode></PostalCode>
  34.             <CountryCode></CountryCode>
  35.          </Address>
  36.       </ShipTo>
  37.       <ShipFrom>
  38.          <Address>
  39.                 <StateProvinceCode>...</StateProvinceCode >
  40.                 <PostalCode>...</PostalCode>
  41.                 <CountryCode>...</CountryCode>
  42.          </Address>
  43.       </ShipFrom>
  44.       <Service>
  45.          <Code>{$service_code}</Code>
  46.       </Service>
  47.       <Package>
  48.          <PackagingType>
  49.             <Code>02</Code>
  50.          </PackagingType>
  51.          <PackageWeight>
  52.             <UnitOfMeasurement>
  53.                <Code>LBS</Code>
  54.             </UnitOfMeasurement>
  55.             <Weight>{$package_weight}</Weight>
  56.          </PackageWeight>
  57.       </Package>
  58.       <RateInformation>
  59.   <NegotiatedRatesIndicator/>
  60.       </RateInformation>
  61.    </Shipment>
  62. </RatingServiceSelectionRequest>
  63. XML;
  64.  

What I got as error is ,
Array ( [RatingServiceSelectionResponse] => Array ( [Response] => Array ( [TransactionReference] => Array ( [CustomerContext] => Shipping [XpciVersion] => 1.0001 ) [ResponseStatusCode] => 0 [ResponseStatusDescription] => Failure [Error] => Array ( [ErrorSeverity] => Hard [ErrorCode] => 10001 [ErrorDescription] => The XML document is not well formed ) ) ) )

What can be the possible solution to that : 10001 - XML doc is not well Formed.
Jun 6 '08 #1
5 2972
jkmyoung
2,057 Expert 2GB
Seems you have 2 files there:
You're not allowed to have the xml processing instruction twice. It's only supposed to be at the beginning of the file before anything else.
<?xml version="1.0"?>

Missing Close of elements:
Some of your closing tags are misrepresented as open tags.
<StateProvinceCode>
<CountryCode>


Mispelled elements
<Adress>

What's the XML; at the end?
Jun 6 '08 #2
ajd335
123 100+
Seems you have 2 files there:
You're not allowed to have the xml processing instruction twice. It's only supposed to be at the beginning of the file before anything else.
<?xml version="1.0"?>

Missing Close of elements:
Some of your closing tags are misrepresented as open tags.
<StateProvinceCode>
<CountryCode>


Mispelled elements
<Adress>

What's the XML; at the end?




Hi...
I have removed the second definition from the document and I am getting
FailureHard250000Missing XML declaration in the XML document error.
Why I am getting that error?

That XML ; at last is reference to the $this->_xml_request =<<<XML before the XML code...
Jun 6 '08 #3
ajd335
123 100+
And further IF i made the changes of the closing formates and have the XML declaration twice , then I am getting

Shipping1.00010FailureHard110122Missing/Invalid Shipper/ShipperNumber..

which i have already given...What should be done here ?
Jun 6 '08 #4
jkmyoung
2,057 Expert 2GB
Do you have a schema for this xml? If so could you post it?
Jun 9 '08 #5
ajd335
123 100+
Do you have a schema for this xml? If so could you post it?
Hey Jkmyoung ,
The error was due to a tag with small letters. :)...So got solved..
Thanks.
Jun 9 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by dody suria wijaya | last post: by
9 posts views Thread by Murat Kelleci | last post: by
3 posts views Thread by David T. Ashley | last post: by
1 post views Thread by Olivier Langlois | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.