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

Namespaces in Header

Expand Messages
  • djnym2002
    Hi, I m attempting to add a custom header in a client which implements the WS-Security specification. I ve been following the example in Programming Web
    Message 1 of 1 , Sep 26 1:57 PM
    • 0 Attachment
      Hi,

      I'm attempting to add a custom header in a client which implements the
      WS-Security specification. I've been following the example in
      "Programming Web Services With Perl" pg 284 and am confused with
      the output.

      Basically I would like xml formed like that listed earlier on that
      page, so something like

      <s:Header>
      <wsse:Security>
      <wsse:UsernameToken>
      <wsse:Username>Foo</wsse:Username>
      <wsse:Password>Bar</wsse:Password>
      </wsse:UsernameToken>
      </wsse:Security>
      </s:Header>

      The example says to use something like

      my $header = SOAP::Header->name(Security => {
      UsernameToken => {
      Username => SOAP::Data->type('' => 'Foo'),
      Password => SOAP::Data->type('' => 'Bar'),
      }
      })->uri($wsse)->prefix('');

      But that relies on a default namespace, so I changed the prefix value
      to wsse, but that only seemed to effect the 'Security' tag, in other
      words the outermost tag. I've been trying various things to get the
      xml to look correct but haven't quite hit on it yet. Is this
      something that I should use XML::Writer for, or does anyone know how
      this is done in SOAP::Lite? Also, does anyone know the reason that
      setting the prefix at the outermost level doesn't work?

      Thanks,

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