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

Problem with Security 'UsernameToken' in XML

Expand Messages
  • Karanth Srihari
    Hello Group, I am facing a problem, would be greatful if your experience and knowledge can help me solve it. I have to query a server for certain response by
    Message 1 of 1 , Oct 19, 2005
    • 0 Attachment
      Hello Group,

      I am facing a problem, would be greatful if your experience
      and knowledge can help me solve it. I have to query a server for
      certain response by passing an XML file as request (the normal way
      the Web Service works). But that server wants my xml to have
      username, password(encrypted in base 64) and a nonce and created
      timestamp.

      But there is a problem. I need to pass this in the soap
      envolup header as XML format and not in the header. (I tried passing
      it in the header but the server didn't recognize it). I created it
      and passed it as below:

      <soap:Header>
      <wsse:Security>
      <wsse:UsernameToken
      xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/utility">
      <wsse:Username>username</wsse:Username>
      <Password Type="Digest">$base64Password</Password>
      <wsse:Nonce EncodingType="Base64">$nonce</wsse:Nonce>
      <wsse:Created>$timestamp</wsse:Created>
      <wsse:Expires>2005-11-18T14:17:09Z</wsse:Expires>
      </wsse:UsernameToken>
      <</wsse:Security>
      </soap:Header>


      but the server is not able to recognize this either. I think its not
      as simple as i have guessed it. It is more complicated.

      And where will I get the `nonce', right now I have hardcoded a nonce
      in my programÂ… but do we have to take it from somewhere or we have to
      create our own as I have done it?



      It would be great helpful if u can reply at the earliest.
      Thanking you immensely,

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