UPS XML Module Erroe..1001

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ajd335
    New Member
    • Apr 2008
    • 123

    UPS XML Module Erroe..1001

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

    Code:
    <?xml version="1.0"?>
    <AccessRequest xml:lang="en-US">
       <AccessLicenseNumber>{$this->_access_key}</AccessLicenseNumber>
       <UserId>{$this->_username}</UserId>
       <Password>{$this->_password}</Password>
    </AccessRequest>
    <?xml version="1.0"?>
    <RatingServiceSelectionRequest xml:lang="en-US">
       <Request>
          <TransactionReference>
             <CustomerContext></CustomerContext>
             <XpciVersion>1.0001</XpciVersion>
          </TransactionReference>
          <RequestAction>{$this->_request_option}</RequestAction>
          <RequestOption>{$this->_request_option}</RequestOption>
       </Request>
       <PickupType>
          <Code>01</Code>
       </PickupType>
       <Shipment>
          <Shipper>
            <shipperNumber>66V7R5</shipperNumber>
            <Adress>
            <City></City>
            <StateProvinceCode><StateProvinceCode>
             <PostalCode></PostalCode>
             <CountryCode>US<CountryCode>
             </Address>
          </Shipper>
          <ShipTo>
             <Address>
                <StateProvinceCode></StateProvinceCode>
                <PostalCode></PostalCode>
                <CountryCode></CountryCode>
             </Address>
          </ShipTo>
          <ShipFrom>
             <Address>
                    <StateProvinceCode>...</StateProvinceCode >
                    <PostalCode>...</PostalCode>
                    <CountryCode>...</CountryCode>
             </Address>
          </ShipFrom>
          <Service>
             <Code>{$service_code}</Code>
          </Service>
          <Package>
             <PackagingType>
                <Code>02</Code>
             </PackagingType>
             <PackageWeight>
                <UnitOfMeasurement>
                   <Code>LBS</Code>
                </UnitOfMeasurement>
                <Weight>{$package_weight}</Weight>
             </PackageWeight>
          </Package>
          <RateInformation>
      <NegotiatedRatesIndicator/>
          </RateInformation>
       </Shipment>
    </RatingServiceSelectionRequest>
    XML;

    What I got as error is ,
    Array ( [RatingServiceSe lectionResponse] => Array ( [Response] => Array ( [TransactionRefe rence] => Array ( [CustomerContext] => Shipping [XpciVersion] => 1.0001 ) [ResponseStatusC ode] => 0 [ResponseStatusD escription] => Failure [Error] => Array ( [ErrorSeverity] => Hard [ErrorCode] => 10001 [ErrorDescriptio n] => The XML document is not well formed ) ) ) )

    What can be the possible solution to that : 10001 - XML doc is not well Formed.
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    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.
    <StateProvinceC ode>
    <CountryCode>


    Mispelled elements
    <Adress>

    What's the XML; at the end?

    Comment

    • ajd335
      New Member
      • Apr 2008
      • 123

      #3
      Originally posted by jkmyoung
      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.
      <StateProvinceC ode>
      <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
      FailureHard2500 00Missing 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...

      Comment

      • ajd335
        New Member
        • Apr 2008
        • 123

        #4
        And further IF i made the changes of the closing formates and have the XML declaration twice , then I am getting

        Shipping1.00010 FailureHard1101 22Missing/Invalid Shipper/ShipperNumber..

        which i have already given...What should be done here ?

        Comment

        • jkmyoung
          Recognized Expert Top Contributor
          • Mar 2006
          • 2057

          #5
          Do you have a schema for this xml? If so could you post it?

          Comment

          • ajd335
            New Member
            • Apr 2008
            • 123

            #6
            Originally posted by jkmyoung
            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.

            Comment

            Working...