2012-04-22 39 views
0

我有一个名为newSettings arrayofstrings字段的SOAP webservice,我试图发送它作为正常的字符串数组使用nusoap,但它不工作,任何建议?发送arryofstring与php + nusoap

我的代码:

$settings=array('password','composefontsize'); 
$param=array(
'EmailAddress'=> $userEmail, 
'newSettings' => $settings 
); 

$response=$this->client->call("GetRequestedUserSettings",$param); 

我的XML请求:

<?xml version="1.0" encoding="ISO-8859-1"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns6388="http://tempuri.org"> 
<SOAP-ENV:Body><GetRequestedUserSettings xmlns="http://tempuri.org/"> 
<AuthUserName>admin</AuthUserName> 
<AuthPassword>XXXX</AuthPassword> 
<EmailAddress>[email protected]</EmailAddress> 
<requestedSettings></requestedSettings> 
</GetRequestedUserSettings> 
</SOAP-ENV:Body> 
</SOAP-ENV:Envelope>" 

更新:我$settings = array('string' => $value1,...)固定它;

+0

该解决方案应该作为答案,以便您可以接受它。 :) – Alfabravo 2017-06-12 18:21:01

回答

0

你可以用肥皂调用:

try { 
    // ... 
} catch (SoapFault $e) { 
    echo $e->faultcode; 
} 

这样,如果你要么不符合WSDL规范或服务器超时,你会意识到这个问题。我相信这在使用SOAP时是必须的。

+0

webservice接受请求,但newSettings标签为空,因此我的数组未被识别。 – nathanr 2012-04-22 17:10:24

+0

我看你修好了,然后恭喜你 – ther 2012-04-22 18:13:08