PHP array problem <ns4:item>
| From: | Thomas Ashbee | Date: | Tue, 25 Nov 2003 13:06:24 +0000 |
| Subject: | PHP array problem <ns4:item> | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-1176@lists.php.net to get a copy of this message | ||
Hi,
Please Please help me here I realy am very stuck here and any help would be
more than appreciated
I am trying to send the following to an sms provider using the wsdl
'http://www.esendex.com/secure/messenger/soap/SendServiceNoHeader.asmx?wsdl'
The xml they expect is
<ns4:SendMessageBatch>
<ns4:username>MYUSERNAME</ns4:username>
<ns4:password>MYPASS</ns4:password>
<ns4:account>MYACCOUNT</ns4:account>
<ns4:messages>
<ns4:messagesubmission>
<ns4:originator>originatorno</ns4:originator>
<ns4:recipient>recipentno</ns4:recipient>
<ns4:body>This is a test message</ns4:body>
<ns4:type>Text</ns4:type>
<ns4:validityperiod>10</ns4:validityperiod>
<ns4:originator>originatorno</ns4:originator>
<ns4:recipient>recipentno</ns4:recipient>
<ns4:body>This is a test message</ns4:body>
<ns4:type>Text</ns4:type>
<ns4:validityperiod>10</ns4:validityperiod>
</ns4:messagesubmission>
</ns4:messages>
</ns4:SendMessageBatch>
However when i use the code below it inserts <ns4:item>
<ns4:SendMessageBatch>
<ns4:username>MYUSERNAME</ns4:username>
<ns4:password>MYPASS</ns4:password>
<ns4:account>MYACCOUNT</ns4:account>
<ns4:messages>
<ns4:messagesubmission>
<ns4:item>
<ns4:originator>originatorno</ns4:originator>
<ns4:recipient>recipentno</ns4:recipient>
<ns4:body>This is a test message</ns4:body>
<ns4:type>Text</ns4:type>
<ns4:validityperiod>10</ns4:validityperiod>
</ns4:item>
<ns4:item>
<ns4:originator>originatorno</ns4:originator>
<ns4:recipient>recipentno</ns4:recipient>
<ns4:body>This is a test message</ns4:body>
<ns4:type>Text</ns4:type>
<ns4:validityperiod>10</ns4:validityperiod>
</ns4:item>
</ns4:messagesubmission>
</ns4:messages>
</ns4:SendMessageBatch>
How do i stop the <ns4:item> being inserted in to the request
$message_array = array(
array('originator' => 'originatorno',
'recipient' => 'recipentno',
'body' => 'This is a test message',
'type' => 'Text',
'validityperiod' => '10'),
array('originator' => 'originatorno',
'recipient' => 'recipentno',
'body' => 'This is a test message',
'type' => 'Text',
'validityperiod' => '10')
);
$secondarray = array('messagesubmission' => $message_array);
print_r($secondarray);
$output = send_message($secondarray);
print_r($output);
function send_message($message_array)
{
require_once('incs/login_details.php');
$wsdl=new
SOAP_WSDL('http://www.esendex.com/secure/messenger/soap/SendServiceNoHeader.
asmx?wsdl');
$wsdl->trace = 1;
$proxy = $wsdl->getProxy();
$send =
$proxy->SendMessageBatch($username,$password,$account,$message_array);
$wsdl->generateAllProxies();
echo $proxy->__getLastRequest();
echo $proxy->__getLastResponse();
return($send);
}