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

Using SOAP::Lite to create a client header I want

Expand Messages
  • lucy3538
    Hi I would like to have this header of this kind of nature.
    Message 1 of 1 , Jun 26, 2008
    • 0 Attachment
      Hi

      I would like to have this header of this kind of nature.

      <?xml version="1.0" encoding="UTF-8"?>
      <soap:Envelope
      xmlns:rep="http://www.alfresco.org/ws/service/repository/1.0"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-
      wssecurity-secext-1.0.xsd">
      <soap:Header>
      <wsse:Security>
      <wsse:UsernameToken>
      <wsse:Username>admin</wsse:Username>
      <wsse:Password
      Type="wsse:PasswordText">admin</wsse:Password>
      <wsse:Nonce/>
      </wsse:UsernameToken>
      </wsse:Security>
      </soap:Header>
      <soap:Body>
      <rep:getStores/>
      </soap:Body>
      </soap:Envelope>

      But i can't work out how to create the header, I am trying (and
      failing) with this:

      $soap->method(SOAP::Header->name('Security\UsernameToken'));
      $soap->method(SOAP::Header->attr('Username'=>'admin'));
      $soap->method(SOAP::Header->attr('Password'=>$session->{ticket}));

      as Element 'Security\UsernameToken' can't be allowed in valid XML
      message. So I am unsure of how to create this nested structure in the
      header?

      Can anyone help? Please
    Your message has been successfully submitted and would be delivered to recipients shortly.