2016-10-06 3 views
1
gefunden

Ich bin mit einem SOAP-Aufruf von PHP zu einer .NET Webservice ein Problem hat. Hoffentlich ist es etwas Einfaches, dass ich vermisse, aber wenn jemand helfen kann, wäre das großartig. Die Seife Anruf unter:PHP: SOAP - Rückkehr HTTP Nicht

// 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)); 

Und es löst die folgende Ausnahme:

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

Wenn ich __getFunctions() auf dem Client aufrufen, gibt sie:

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)" 
} 

Hier ist mein Anfrage erzeugt wird, wenn ich __getLastRequest auf dem Client aufrufen:

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

Und hier ist ein Beispiel Anfrage von der Webservice-Dokumentation:

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

Ich habe versucht, einen Blick in den Ursachen der Fehler ‚Nicht gefunden‘ haben aber nichts Konkretes gefunden. Von dem, was ich gefunden habe, sollten die Unterschiede in Namespaces kein Problem verursachen? Jede Hilfe wäre willkommen.

Antwort

1

faultCode "HTTP" und faultString "nicht gefunden" zeigt, dass der Client den Server nicht erreichen kann (Endpunkt).

Die WSDL ist verfügbar, aber es scheint der Service-Endpunkt http://connect7.gardners.com/PriceAvail/priceavail.asmx nicht.

+0

Das Projekt wurde auf Eis gelegt, daher meine Verzögerung bei der Annahme. Aber das ist wahrscheinlich der Grund. Danke für deine Antwort. –