1

我正在尝试向 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>
4

1 回答 1

3

它现在给了我一个无效的跟踪号,所以我想我明白了。问题是无效的端点。我正在使用跟踪 API,所以端点应该是

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

于 2013-02-28T21:17:46.653 回答