开发者

How to pass the parameters using multidimensional array in webservice

How can I pass the parameters in web service using this request:

POST /webservice/User.asmx HTTP/1.1 Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://sample.com/UpdateUserBatch"

<UpdateUserBatch xmlns="http://sample.com/">
  <auth>
    <Username>string</Username>
    <Password>string</Password>
  </auth>
  <request>
    <CreateIfNotExist>boolean</CreateIfNotExist>
    <UpdateIfExists>boolean</UpdateIfExists>
    <Users>
      <UserProfile>
        <UserID>string</UserID>
        <BusinessID>string</BusinessID>
        <ExternalID>string</ExternalID>
        <Username>string</Username>
        <Password>string</Password>
        <UpdateDate>dateTime</UpdateDate>
      </UserProfile>
      <UserProfile>
        <UserID&g开发者_如何学Ct;string</UserID>
        <BusinessID>string</BusinessID>
        <ExternalID>string</ExternalID>
        <Username>string</Username>
        <Password>string</Password>
        <UpdateDate>dateTime</UpdateDate>
      </UserProfile>
    </Users>
  </request>
</UpdateUserBatch>

I'd like to import data using the that web service.


I'm not sure with POST requests, but in GET requests you usually use square bracket notation for multi-dimension arrays. For example:

http://api.example.com/object/?foo[]=bar&foo[]=baz

This would be assembled, API side, like thus:

'foo' => array(
    0 => 'bar',
    1 => 'baz'
);

Of course, you could use indexed arrays as well as numerical arrays.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜