I'm trying to create a Soap connection. The error I'm getting is:
SOAP Fault: (faultcode: Client faultstring: looks like we got no XML document)
I have my code below. Any suggestions of where to look from here?
$myproxy = new SoapClient('https://example.com/index.php/api/v2_soap/index/?wsdl');
try {
$sess = $myproxy->login('user','password');
} catch(Soapfault $err) {
$error_message = "SOAP Error: (faultcode: {$err->faultcode}\n" ."faultstring: {$err->faultstring})";
echo $error_message;
}
I've tried troubleshooting the WSDL file by going to https://example.com/index.php/api/v2_soap/index/?wsdl, saving it as an XML file and running it through wsdl-analyzer.com. The error I got was:
The structure of your WSDL is types (1) message (12) portType (1) binding (1) service (1) message (288) But should be types messages portTypes bindings services