Robin Michael Poothurai
Robin Michael Poothurai

Reputation: 5664

PHP: SOAP webservice client to ASP.NET webservice server

I was trying to connect to asp.net webservice from PHP, I dont want to use nuSOAP I have created SOAP client using default SoapClient()

$options = array('style'=>SOAP_DOCUMENT,
        'use'=>SOAP_LITERAL,
        'soap_version'=>SOAP_1_1, 
        'exceptions'=>1, 
        'trace'=>1
    );

$clnt = new SoapClient('webserviceURL?wsdl', $options);
$clnt ->__Call('method', array('param'=>'val'));

Now, Webservice server is not recogising my Parameter that I am passing to the webservice method.

Can Anyone help me ?

Upvotes: 0

Views: 1695

Answers (2)

Robin Michael Poothurai
Robin Michael Poothurai

Reputation: 5664

Yes, I got the Answer

$params = array('param'=>'val');
$resp = $clnt->method(array('param'=>$params));

'method' is webservice method you want to call

Method mentioned by Furgas will also work

Upvotes: 0

Furgas
Furgas

Reputation: 2844

If the webservice expects document/literal wrapped calling convention then you should put method parameters inside additional array:

$clnt ->__Call('method', array(array('param'=>'val')));

Upvotes: 2

Related Questions