Reputation: 25
I'm having an issue with a SOAP call from PHP to a .NET webservice. Hopefully it's something simple that I'm missing, but if anyone can help out then that would be great. The soap call is below:
// 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));
And it triggers the following exception:
Fatal error: SOAP Fault: (faultcode: HTTP, faultstring: Not Found)
If I call __getFunctions() on the client, it returns:
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)"
}
Here is my request, generated when I call __getLastRequest on the client:
<?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>
And here is an example request from the webservice documentation:
<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>
I've tried looking into what causes the error 'Not Found' but haven't found anything concrete. From what I've found the differences in namespaces shouldn't cause an issue? Any help would be appreciated.
Upvotes: 1
Views: 3619
Reputation: 146
Faultcode "HTTP" and Faultstring "Not Found" indicate that your client cannot reach the server (endpoint).
The WSDL is available but it seems the service endpoint http://connect7.gardners.com/PriceAvail/priceavail.asmx is not.
Upvotes: 2