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

Re: [soaplite] Creating a hash of the soap:Body contents

Expand Messages
  • Byrne Reese
    Have you looked at the XML::Sig Perl Module?
    Message 1 of 3 , Apr 19 10:03 AM
    • 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 2 of 3 , Apr 23 3:10 AM
      • 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.