Loading ...
Sorry, an error occurred while loading the content.

question about adding name space to nested elements

Expand Messages
  • jomi_song
    Hi everyone, I am new to SOAP Lite and have a question about adding sub name spaces to nested header elements. With the following method call, my $header =
    Message 1 of 1 , Jun 24, 2003
    • 0 Attachment
      Hi everyone,

      I am new to SOAP Lite and have a question about adding sub name spaces
      to nested header elements.

      With the following method call,
      my $header = SOAP::Header
      ->name(authentication => {
      basic => { username
      =>$user_id,
      hash =>
      $encoded,
      }
      }
      )->prefix('ns1')
      ->actor("http://locathost")
      ->mustUnderstand(1)
      ->uri($NS);


      SOAP Lite build the following header:

      <SOAP-ENV:Header>
      <ns1:authentication xmlns:ns1="http://localhost/authentication"
      SOAP-ENV:mustUnderstand="1" xsi:type="namesp1:SOAPStruct"
      SOAP-ENV:actor="http://localhost/authenticator">
      <basic xsi:type="namesp1:SOAPStruct">
      <username xsi:type="xsd:string">xxxxx</username>
      <hash xsi:type="xsd:string">xxxxxxxxxxx</hash>
      </basic>
      </ns1:authentication>
      </SOAP-ENV:Header>


      But what I would like to have is putting ns1 before basic and its sub
      elements.

      The correct one should look like this:

      <ns1:basic xsi:type="namesp1:SOAPStruct">
      <ns1:username xsi:type="xsd:string">xxxxx</ns1:username>
      <ns1:hash xsi:type="xsd:string">xxxxxxxxxxx</ns1:hash>
      </ns1:basic>



      I would appreciate a lot if anyone helps me on this problem.


      Thanks,

      Min
    Your message has been successfully submitted and would be delivered to recipients shortly.