0
私は以下の石鹸文字列を持っています。soapclientに文字列としてsoapを渡す方法
$str = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">';
$str .= '<soapenv:Header/>';
$str .= '<soapenv:Body>';
$str .= '<Username>uname1</Username>';
$str .= '<Password>upassword1</Password>';
$str .= '<RequestType>GetDiamonds</RequestType>';
$str .= '<ClientId>51</ClientId>';
$str .= '<MySoapReq>';
$str .= '<Params>';
$str .= '<Diamond_ID>%18112%</Diamond_ID>';
$str .= '<Diamond_ID>%1625%</Diamond_ID>';
$str .= '<Diamond_ID>%18625%</Diamond_ID>';
$str .= '</Params>';
$str .= '</MySoapReq>';
$str .= '</soapenv:Body>';
$str .= '</soapenv:Envelope>';
私はそれを次のように呼び出そうとしていますが、上記の文字列をSOAPリクエストに渡す方法はわかりません。
$client = new SoapClient(null, array('location' => 'http://localhost:8080/testsoap',
'uri'=>'http://localhost:8080/testsoap'
));
ここでもユーザー名とパスワードを入力してみましたが、動作しませんでした。
$return = $client->__soapCall("GetDiamonds",
array(new SoapParam($str))
);
私は石鹸リクエストで上記の文字列をどのように渡すことができ、応答を得ることができますか?正しい方法でやっているのですか、それとも他の方法が必要ですか?