简体   繁体   English

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

[英]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() 我试图从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'));

Now, Webservice server is not recogising my Parameter that I am passing to the webservice method. 现在,Web服务服务器没有识别我传递给webservice方法的参数。

Can Anyone help me ? 谁能帮我 ?

如果webservice期望document / literal包装调用约定,那么你应该将方法参数放在另外的数组中:

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

Yes, I got the Answer 是的,我得到了答案

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

'method' is webservice method you want to call 'method'是您要调用的webservice方法

Method mentioned by Furgas will also work Furgas提到的方法也可以

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM