I am trying to set up a SOAP client on one server to communicate with Magento on a test server. Both servers have PHP's SOAP extension installed, configured and show up in phpinfo()
.
Tried turning off caching, using the v2 and v1 APIs and everything else I could think of. Regardless, I keep getting the same problems.
Either its:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>
Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL:
Couldn't find <definitions> in 'http://myserver.com/api/v2_soap?wsdl=1'
in dispatch.php:39
Stack trace: #0 dispatch.php(39):
SoapClient->SoapClient('http://myserver.com/...', Array) #1 {main} thrown
</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
or sometimes another error SOAP doesn't allow DTD....
I'm now using just the plain Magento example code from here, instead of running anything significant, until I can figure out what's going on with this.
If I do file_get_contents
to the service URL, I get:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns:typens="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="Magento" targetNamespace="urn:Magento">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="associativeEntity">
<all>
<element name="key" type="xsd:string"/>
<element name="value" type="xsd:string"/>
</all>
</complexType>
.
.
.
</definitions>
So seems like it should not have trouble parsing this.. idk.