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

Creating a hash of the soap:Body contents

Expand Messages
  • precisionlyte
    Hi all, I have a problem and can t spot how to solve it. I have Googled and searched the archive here but can t find anything, so my apologies if this has
    Message 1 of 3 , Apr 19, 2010
    • 0 Attachment
      Hi all,

      I have a problem and can't spot how to solve it. I have Googled and searched the archive here but can't find anything, so my apologies if this has been covered in the past.

      I need to put a base64 encoded, SHA1 hash of the canonicalized contents of the soap:Body into a security header of my message. Creating this value is easy enough, as is putting it in the right place. The step I'm having trouble with is getting the body contents to canonicalize and hash.

      I get a method name and chunk of XML (which is to be the sole parameter of my method) from elsewhere but I need to hash the entire contents of the soap:Body once the message is created to ensure the correctness of the hash.

      Is there an easy way to achieve this, namely extracting the XML to be sent before the message is sent?

      Many thanks,

      Paul.
    • Byrne Reese
      Have you looked at the XML::Sig Perl Module?
      Message 2 of 3 , Apr 19, 2010
      • 0 Attachment
        Have you looked at the XML::Sig Perl Module?

        On Apr 19, 2010, at 9:49 AM, precisionlyte wrote:

        > Hi all,
        >
        > I have a problem and can't spot how to solve it. I have Googled and searched the archive here but can't find anything, so my apologies if this has been covered in the past.
        >
        > I need to put a base64 encoded, SHA1 hash of the canonicalized contents of the soap:Body into a security header of my message. Creating this value is easy enough, as is putting it in the right place. The step I'm having trouble with is getting the body contents to canonicalize and hash.
        >
        > I get a method name and chunk of XML (which is to be the sole parameter of my method) from elsewhere but I need to hash the entire contents of the soap:Body once the message is created to ensure the correctness of the hash.
        >
        > Is there an easy way to achieve this, namely extracting the XML to be sent before the message is sent?
        >
        > Many thanks,
        >
        > Paul.
        >
        >
      • precisionlyte
        OK after a bit of help and some more searching, I ve come up with a method that works. I ve created a custom serializer and over-ridden envelope(). Then it s
        Message 3 of 3 , Apr 23, 2010
        • 0 Attachment
          OK after a bit of help and some more searching, I've come up with a method that works.

          I've created a custom serializer and over-ridden envelope(). Then it's just a matter of grabbing the contents of soap:Body with a search, calculating the hash and then putting the generated value back in the wsse header.

          Many thanks for all the help,

          Paul

          --- In soaplite@yahoogroups.com, Byrne Reese <byrne@...> wrote:
          >
          > Have you looked at the XML::Sig Perl Module?
          >
          > On Apr 19, 2010, at 9:49 AM, precisionlyte wrote:
          >
          > > Hi all,
          > >
          > > I have a problem and can't spot how to solve it. I have Googled and searched the archive here but can't find anything, so my apologies if this has been covered in the past.
          > >
          > > I need to put a base64 encoded, SHA1 hash of the canonicalized contents of the soap:Body into a security header of my message. Creating this value is easy enough, as is putting it in the right place. The step I'm having trouble with is getting the body contents to canonicalize and hash.
          > >
          > > I get a method name and chunk of XML (which is to be the sole parameter of my method) from elsewhere but I need to hash the entire contents of the soap:Body once the message is created to ensure the correctness of the hash.
          > >
          > > Is there an easy way to achieve this, namely extracting the XML to be sent before the message is sent?
          > >
          > > Many thanks,
          > >
          > > Paul.
          > >
          > >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.