2013-02-28 63 views
1

我試圖發送一個測試UPS跟蹤API,但我不斷收到以下錯誤UPS肥皂跟蹤API,但得到錯誤...的faultcode VersionMismatch

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> 

回答

3

它現在給我一個無效的跟蹤號碼,所以我想我想通 出來。問題是一個無效的端點。我使用的追蹤API,以便端點應該

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

+1

這是測試環境終點。您應該使用的端點是「https:// onlinetools.ups.com/webservices/Track」 – 2013-04-20 23:14:39