我正在与之通信的soap服务器中有三个接口。 我想与以下界面进行通信。 以下是soap ui的请求代码。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rint="http://rint.crm.ailk.com" xmlns:xsd="http://bo.out.intframe.ailk.com/xsd" xmlns:xsd1="http://bo.partner.out.lint.abc.prbinfo.com/xsd">
<soapenv:Header/>
<soapenv:Body>
<rint:balanceTransfer>
<!--Optional:-->
<rint:commonHeader>
<!--Optional:-->
<xsd:acceptChannel>?</xsd:acceptChannel>
<!--Optional:-->
<xsd:acceptType>?</xsd:acceptType>
</rint:commonHeader>
<!--Optional:-->
<rint:balanceTransferReq>
<!--Optional:-->
<xsd1:balanceRecord>
<!--Optional:-->
<xsd1:amount>?</xsd1:amount>
<!--Optional:-->
<xsd1:hold1>?</xsd1:hold1>
<!--Optional:-->
<xsd1:operationType>?</xsd1:operationType>
</xsd1:balanceRecord>
</rint:balanceTransferReq>
</rint:balanceTransfer>
</soapenv:Body>
</soapenv:Envelope>
到目前为止我的代码如下:
<?php
//Initiate SOAP connection with SOAP server
$wsdl = "wsdl_link_from_my_api_provider_which_is_now_on_their_private_network";
$client = new SoapClient($wsdl);
//set parameters
$params = array("ChannelID" => "0001", "AccessType" => "14");
$params1 = array(
"amount" => "100",
"hold1" => "3099",
"operationType" => "1"
);
//send request and receive response
$response = $client->__soapCall("balanceTransferReq", $params, $params1);
?>
我从服务器收到错误,因为我不知道在这种情况下发送参数的正确方法。