UPS Soap Tracking API但是收到错误... faultcode VersionMismatch

时间:2013-02-28 17:19:43

标签: php api soap ups

我正在尝试向UPS跟踪API发送测试,但我不断收到以下错误

SoapFault: Wrong Version in...

以下是我发送的申请文件

    <?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>

以下是我的xml回复

<?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>

1 个答案:

答案 0 :(得分:3)

它现在给我一个无效的追踪号码,所以我想我已经明白了。问题是端点无效。我正在使用跟踪API,因此端点应为

  

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