简体   繁体   中英

UPS Soap Tracking API But getting error … faultcode VersionMismatch

I am trying to send a test to UPS tracking API, but i keep getting the following error

SoapFault: Wrong Version in...

Below is my Request Document I send

    <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:ns1="http://www.ups.com/XMLSchema/XOLTWS/Common/v1.0" 
    xmlns:ns2="http://www.ups.com/XMLSchema/XOLTWS/Track/v2.0" 
    xmlns:ns3="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0">
        <SOAP-ENV:Header>
            <ns3:UPSSecurity>
                <ns3:UsernameToken>
                    <ns3:Username>username</ns3:Username>
                    <ns3:Password>password</ns3:Password>
                </ns3:UsernameToken>
                <ns3:ServiceAccessToken>
                    <ns3:AccessLicenseNumber>855566598C34</ns3:AccessLicenseNumber>
                </ns3:ServiceAccessToken>
            </ns3:UPSSecurity>
        </SOAP-ENV:Header>
        <SOAP-ENV:Body>
            <ns2:TrackRequest>
                <ns1:Request>
                    <ns1:RequestOption>15</ns1:RequestOption>
                    <ns1:TransactionReference>
                        <ns1:CustomerContext>Add description here</ns1:CustomerContext>
                    </ns1:TransactionReference>
                </ns1:Request>
                <ns2:InquiryNumber></ns2:InquiryNumber>
                <ns2:TrackingOption>02</ns2:TrackingOption>
            </ns2:TrackRequest>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

Below is my xml response

<?xml version="1.0"?>
<TrackResponse>
    <Response>
        <ResponseStatusCode>0</ResponseStatusCode>
        <ResponseStatusDescription>Failure</ResponseStatusDescription>
        <Error>
            <ErrorSeverity>Hard</ErrorSeverity>
            <ErrorCode>10002</ErrorCode>
            <ErrorDescription>The XML document is well formed but the document is not valid</ErrorDescription>
        </Error>
    </Response>
</TrackResponse>

Its giving me a invalid tracking number now so I think I figured it out. The problem was a invalid endpoint. I am using the tracking API so the endpoint should be

https://wwwcie.ups.com/webservices/Track

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM