Topic
  • 2 replies
  • Latest Post - ‏2013-04-30T21:56:17Z by tacsman4
tacsman4
tacsman4
2 Posts

Pinned topic Calculate checksum on binary attachment

‏2013-04-25T03:51:31Z |

Hello DP forum,

I have a use case where I need to process attachment (MTOM) in a SOAP message. Before processing, we'd like to calculate checksum on the binary attachment to verify file integrity. How do I go about doing this? I don't see any action or extension function that would allow me to do so. Does DataPower have this capability? Any suggestions appreciated.

TIA

  • HermannSW
    HermannSW
    5936 Posts

    Re: Calculate checksum on binary attachment

    ‏2013-04-25T17:35:11Z  

    If you mean "hash" with "checksum", then please see posting "hash(gzip(Non-XML))":
    https://www.ibm.com/developerworks/community/blogs/HermannSW/entry/hash_gzip_non_xml39

    There Non-XML input gets hashed by "dp:hash-base64()".
    If that is what is needed in your case, you can just open your attachment by
    <dp:url-open target="attachment://CONTEXT-NAME/cid:ATTACHMENT-NAME?Encode=base64"/>


    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

  • tacsman4
    tacsman4
    2 Posts

    Re: Calculate checksum on binary attachment

    ‏2013-04-30T21:56:17Z  
    • HermannSW
    • ‏2013-04-25T17:35:11Z

    If you mean "hash" with "checksum", then please see posting "hash(gzip(Non-XML))":
    https://www.ibm.com/developerworks/community/blogs/HermannSW/entry/hash_gzip_non_xml39

    There Non-XML input gets hashed by "dp:hash-base64()".
    If that is what is needed in your case, you can just open your attachment by
    <dp:url-open target="attachment://CONTEXT-NAME/cid:ATTACHMENT-NAME?Encode=base64"/>


    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

    This resolved my issue Hermann. I ended up using your suggested <dp:url-open target="attachment://CONTEXT-NAME/cid:ATTACHMENT-NAME?Encode=base64"/>. Thanks!