views:

36

answers:

1

Hi All,

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/"&gt;
  <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>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.

A: 

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&amp;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.

Martin Bean
thank you for your reply but it seems doesn't work. I got an error "Service Unavailable".
rayss
That's not a problem with your implementation, but the actual service you're sending your request to.
Martin Bean