2016-10-06 22 views
1

PHPから.NET WebサービスへのSOAP呼び出しに問題があります。うまくいけば、それは私が行方不明の単純なものですが、誰かがそれを助けることができるなら、それは素晴らしいだろう。PHP:SOAP - HTTPを返すことがありません

// Start client: 
$client = new SoapClient('http://connect7.gardners.com/priceavail.asmx?wsdl', array 
(
    // Options: 
    'trace' => 1 
)); 

// Params: 
$params = array(...) 

// Call: 
$response = $client->__soapCall("PriceAvailabilityRequest", array($params)); 

そして、それは次の例外トリガー:SOAPコールは以下の通りです、私は、クライアント上__getFunctions()を呼び出した場合

Fatal error: SOAP Fault: (faultcode: HTTP, faultstring: Not Found) 

、それが返されます。

array(4) { 
    [0]=> string(65) "Gardners_HelloResponse Gardners_Hello(Gardners_Hello $parameters)" 
    [1]=> string(95) "PriceAvailabilityRequestResponse PriceAvailabilityRequest(PriceAvailabilityRequest $parameters)" 
    [2]=> string(65) "Gardners_HelloResponse Gardners_Hello(Gardners_Hello $parameters)" 
    [3]=> string(95) "PriceAvailabilityRequestResponse PriceAvailabilityRequest(PriceAvailabilityRequest $parameters)" 
} 

ここに私のですがクライアントで__getLastRequestを呼び出すと生成されるリクエスト:

<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.bic.org.uk/webservices" xmlns:ns2="http://connect7.gardners.com/"> 
    <SOAP-ENV:Body> 
     <ns2:PriceAvailabilityRequest> 
      <ns2:PA_Request> 
       <ns1:Header> 
        <ns1:ClientID>XXXXXX</ns1:ClientID> 
        <ns1:ClientPassword>XXXXXX</ns1:ClientPassword> 
        <ns1:AccountIdentifier> 
         <ns1:AccountIDType>02</ns1:AccountIDType> 
        </ns1:AccountIdentifier> 
        <ns1:SupplierIdentifier> 
         <ns1:SupplierIDType>02</ns1:SupplierIDType> 
        </ns1:SupplierIdentifier> 
        <ns1:SupplierRegionsCoded> 
         <ns1:SupplierRegionCodeType>01</ns1:SupplierRegionCodeType> 
        </ns1:SupplierRegionsCoded> 
        <ns1:CurrencyCode>GBP</ns1:CurrencyCode> 
       </ns1:Header> 
       <ns1:Product> 
        <ns1:EAN13>9780007185580</ns1:EAN13> 
        <ns1:ProductIdentifier> 
         <ns1:ProductIDType>15</ns1:ProductIDType> 
        </ns1:ProductIdentifier> 
       </ns1:Product> 
      <ns2:PA_Request> 
     </ns2:PriceAvailabilityRequest> 
    </SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 
私は、エラー「が見つかりません」が、具体的な何かを発見していない原因を覗く試してみた

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:con="http://connect7.gardners.com/" xmlns:web="http://www.bic.org.uk/webservices"> 
    <soapenv:Header/> 
    <soapenv:Body> 
     <con:PriceAvailabilityRequest> 
      <con:PA_Request version="1.2"> 
       <web:Header> 
        <web:ClientID>XXXXXXX</web:ClientID> 
        <web:ClientPassword>XXXXXX</web:ClientPassword> 
        <web:AccountIdentifier> 
         <web:AccountIDType>02</web:AccountIDType> 
        </web:AccountIdentifier> 
        <web:SupplierIdentifier> 
         <web:SupplierIDType>02</web:SupplierIDType> 
        </web:SupplierIdentifier> 
        <web:SupplierRegionsCoded> 
         <web:SupplierRegionCodeType>01</web:SupplierRegionCodeType> 
        </web:SupplierRegionsCoded> 
        <web:CurrencyCode>GBP</web:CurrencyCode> 
       </web:Header> 
       <web:Product> 
        <web:EAN13>9780762444205</web:EAN13> 
        <web:ProductIdentifier> 
         <web:ProductIDType>15</web:ProductIDType> 
        </web:ProductIdentifier> 
       </web:Product> 
      </con:PA_Request> 
     </con:PriceAvailabilityRequest> 
    </soapenv:Body> 
</soapenv:Envelope> 

そしてここでは、Webサービスのドキュメントからの例要求です。私が見つけたことから、名前空間の違いは問題を起こすべきではありませんか?どんな助けもありがとう。

答えて

1

フォルトコード "HTTP"およびフォルトストリング "Not Found"は、クライアントがサーバー(エンドポイント)に到達できないことを示します。

WSDLは利用可能ですが、サービスエンドポイントはhttp://connect7.gardners.com/PriceAvail/priceavail.asmxのようです。

+0

プロジェクトが保留になりましたので、受け入れが遅れました。しかし、これがもっともらしい理由です。お返事をありがとうございます。 –