0

という名前の arrayofstrings フィールドを持つ SOAP Web サービスnewSettingsがあります。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>xxx@xxx</EmailAddress>
<requestedSettings></requestedSettings>
</GetRequestedUserSettings>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>"

更新:私はそれを修正しました$settings = array('string' => $value1,...);

4

1 に答える 1

0

ソープコールを次のようにラップできます。

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

このようにして、WSDL仕様を満たしていないか、サーバーがタイムアウトした場合に、問題に気付くでしょう。これはSOAPを使用する場合の必須事項だと思います。

于 2012-04-22T17:00:20.380 に答える