SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast Gods Lonely Man's Avatar
    Join Date
    Sep 2006
    Location
    Yes
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [php] function call with XML attributes

    The webservice I'm using requires a xml parameter with attributes.
    Like this:
    Code XML:
    <test>
    <user group="4" type="default">Max</user>
    <birthday>1-2-1980</birthday>
    </test>

    So far I got:
    PHP Code:
    $reqBody = array('test' => array(
                               
    'user' => 'Max',
                               
    'birthday'=>'1-2-1980'));

    $result $client->getUser($reqBody); 
    What will produce a soap body containing:
    Code XML:
    <test>
    <user>Max</user>
    <birthday>1-2-1980</birthday>
    </test>
    Only I've got no idea how to put in the attributes. Does anyone know?
    I have no capslock and I must scream....

  2. #2
    SitePoint Member
    Join Date
    Nov 2010
    Location
    Rumia
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Without seeing function which creates the structure I can't say what needs to be done here. Did you try nesting another array with attributes?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •