$client = new SoapClient("http://soap.m4u.com.au/?wsdl", array("trace" => 1));
$params = array(
"authentication" => array(
"userId" => "user",
"password" => "pass"
),
"requestBody" => array(
"messages" => array(
"message" => array(
"recipients" => array("recipient" => array("1" => "9799996899")),
"content" => "Message Content"
)
)
)
);
$response = $client->__soapCall("sendMessages", array($params));
Но я получаю следующую ошибкуФатальная ошибка: Uncaught SoapFault исключение: [SOAP-ENV: Client] Запрос либо не правильно сформированным или не действует в отношении соответствующей схемы
Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] The request is either not well-formed or is not valid against the relevant schema.
I нужен формат запроса, как показано ниже.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://xml.m4u.com.au/2009">
<soapenv:Header/>
<soapenv:Body>
<ns:sendMessages>
<ns:authentication>
<ns:userId>Username</ns:userId>
<ns:password>Password</ns:password>
</ns:authentication>
<ns:requestBody>
<ns:messages>
<ns:message format="SMS" sequenceNumber="1">
<ns:recipients>
<ns:recipient uid="1">61400000001</ns:recipient>
<ns:recipient uid="2">61400000002</ns:recipient>
</ns:recipients>
<ns:content>Message Content</ns:content>
</ns:message>
</ns:messages>
</ns:requestBody>
</ns:sendMessages>
</soapenv:Body>
</soapenv:Envelope>
Как я могу достичь этого, пожалуйста, помогите.