PHP: SOAP web服务客户端到ASP.. NET web服务服务器


PHP: SOAP webservice client to ASP.NET webservice server

我试图从PHP连接到asp.net webservice,我不想使用nuSOAP我已经使用默认的SoapClient()创建了SOAP客户端

$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'));

现在,Webservice服务器无法识别我传递给Webservice方法的参数。

有人能帮我吗?

如果webservice期望文档/文字包装调用约定,那么你应该将方法参数放在附加数组中:

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

是的,我知道答案了

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

'method'是你想要调用的webservice方法

Furgas提到的方法也可以