logo       

How NuSOAP client to post array?: msg#00050

php.nusoap.general

Subject: How NuSOAP client to post array?

Hi.. I am having problem to post data of type array to
webservice. Here is my code:-

/**** The wsdl file ******/
......

<message name='zeon.deliverMessage'>
<part name='ApplicationId' type='xsd:short'/>
<part name='Login' type='xsd:string'/>
<part name='Password' type='xsd:string'/>
<part name='MessageId' type='xsd:double'/>
<part name='MessageLinkId' type='xsd:double'/>
<part name='MessageContentType'
type='xsd:string'/>
<part name='MessageType' type='xsd:string'/>
<part name='Message' type='xsd:anyType'/>
<part name='MessageExpiryTime' type='xsd:short'/>
</message>

......

/**** my client code *****/

require_once("nusoap.php");

$application_id = "123";
$login = "test";
$password = "test";
$message_id = "123456";
$message_link_id = "123456";
$message_content_type = "A";
$message = array("Message 1", "Message 2");
$message_expiry_time = "";

$soap_client = new soapclient($wsdl_file, 'wsdl');
$soap_proxy = $soap_client->getProxy();
$soap_return = $soap_proxy->deliverMessage(
$application_id,
$login,
$password,
$message_id,
$message_link_id,
$message_content_type,
$message,
$message_expiry_time
);

.........

When i print $soap_proxy->request, here what i get:-

POST /test/ HTTP/1.0
Host: 127.0.0.1 User-Agent: NuSOAP/0.6.9 (1.87)
Content-Type: text/xml; charset=ISO-8859-1
SOAPAction:
"http://tempuri.org/action/zeon.deliverMessage";
Content-Length: 1663

<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope

SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";

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:si="http://soapinterop.org/xsd";
xmlns:ns2834="http://tempuri.org/message/";>
<SOAP-ENV:Body>
<ns2834:deliverMTMessage
xmlns:ns2834="http://tempuri.org/message/";>
<ApplicationId
xsi:type="xsd:short">123</ApplicationId>
<Login xsi:type="xsd:string">test</Login>
<Password xsi:type="xsd:string">test</Password>
<MessageID xsi:type="xsd:double">123456</MessageID>
<MessageLinkID
xsi:type="xsd:double">123456</MessageLinkID>
<MessageContentType
xsi:type="xsd:string">A</MessageContentType>
<Message xsi:type="xsd:anyType">Array</Message>

<MessageExpiryTimexsi:type="xsd:short"></MessageExpiryTime>
</ns2834:deliverMessage>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The 'Message' is define as Array. How can i achive
data as below?
......

<Message xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="xsd:string[2]">
<item xsi:type="xsd:string">Message 1</item>
<item xsi:type="xsd:string">Message 2</item>
</Message>
............

Thanks for you help.
-Chetit-.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise