2011-08-31 4 views
0

:이 오류와UPS의 API ... 잘 구성된 XML 문제는 UPS 서버가 나에게이 응답주는 유지

HTTP/1.1 200 OK 
Server: Apache 
Content-Length: 429 
X-Powered-By: Servlet/2.5 JSP/2.1 
Content-Type: application/xml 
Expires: Wed, 31 Aug 2011 21:28:12 GMT 
Cache-Control: max-age=0, no-cache, no-store 
Pragma: no-cache 
Date: Wed, 31 Aug 2011 21:28:12 GMT 
Connection: keep-alive 

: 여기

<AddressValidationResponse> 
    <Response> 
     <TransactionReference> 
     <XpciVersion>1.0001</XpciVersion> 
     </TransactionReference> 
     <ResponseStatusCode>0</ResponseStatusCode> 
     <ResponseStatusDescription>Failure</ResponseStatusDescription> 
     <Error> 
     <ErrorSeverity>Hard</ErrorSeverity> 
      <ErrorCode>10001</ErrorCode> 
      <ErrorDescription>The XML document is not well formed</ErrorDescription> 
     </Error> 
    </Response> 
</AddressValidationResponse> 

는 PHP 코드 I입니다 서버로 보내고 있습니다. 내가 놓치고 간과하고있는 오류가 있습니까?

$data = '<?xml version=\"1.0\" ?> 
       <AccessRequest xml:lang=\"en-US\"> 
        <AccessLicenseNumber>$this->AccessLicenseNumber</AccessLicenseNumber> 
        <UserId>$this->UserId</UserId> 
        <Password>$this->Password</Password> 
       </AccessRequest> 
       <?xml version=\"1.0\" ?> 
       <AddressValidationRequest xml:lang=\"en-US\"> 
        <Request> 
         <TransactionReference> 
          <XpciVersion>1.0001</XpciVersion> 
         </TransactionReference> 
         <RequestAction>XAV</RequestAction> 
         <RequestOption>3</RequestOption> 
        </Request> 
        <AddressKeyFormat> 
         <AddressLine>$address</AddressLine> 
         <PoliticalDivision2>$city</PoliticalDivision2> 
         <PoliticalDivision1>$state</PoliticalDivision1> 
         <PostcodePrimaryLow>$zip</PostcodePrimaryLow> 
         <CountryCode>US</CountryCode> 
        </AddressKeyFormat> 
       </AddressValidationRequest>'; 

어떤 도움을 주시면 감사하겠습니다. 고맙습니다.

답변

4

이 같이 당신의 XML을 포장 " 대신 '을 사용할 수 있습니다

$data="<?xml..."; 

PHP는 "

+0

아의 내부 변수를 대체합니다! 내 끔찍한 감시가 뭐야! 그게 내 오류 10001 없애 버렸어 ...하지만 지금 AccessRequest/UserId에 위치한 오류 10002가 나타납니다. –

+0

'$ this-> UserId' (아마도 $ UserId ?!)가 설정되어 있는지 확인하십시오. – stewe