I am having trouble figuring out how to make soap requests.
First I load the wsdl document.
$sclient=new SoapClient('wsdl.asmx');
Then when i look in the return from __getFunctions() I have this string
simpleFunction( simpleFunction $parameters )
And in __getTypes() I have this string
struct simpleFunction{ string oid; string Username; string Password;}
I have been trying all kinds of combinations of arrays, SoapParams, and SoapVars, but I always get an error like this:
Fatal error: Uncaught SoapFault exception: [soap:Server] Server was unable to process request. –> Object reference not set to an instance of an object. in C:\path.php:21 Stack trace: #0 [internal function]: SoapClient->__call(‘handleSimpleUse…’, Array) #1 C:\path(21): SoapClient->simpleFunction(Array)
Here is the code of my latest attempt
$sclient=new SoapClient('wsdl.asmx');
$params=array(
new SoapVar('aaa',XSD_STRING,'oid'),
new SoapVar('bbb',XSD_STRING,'Password'),
new SoapVar('ccc',XSD_STRING,'Username')
);
$result=$sclient->simpleFunction($params);
How am I supposed to correctly format this soap request?
I solved this by using http://www.urdalen.no/wsdl2php/ to generate classes to use from the wsdl file.