簡體   English   中英

PHP:SOAP webservice客戶端到ASP.NET webservice服務器

[英]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'));

現在,Web服務服務器沒有識別我傳遞給webservice方法的參數。

誰能幫我 ?

如果webservice期望document / literal包裝調用約定,那么你應該將方法參數放在另外的數組中:

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

是的,我得到了答案

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

'method'是您要調用的webservice方法

Furgas提到的方法也可以

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM