How to handle base64Binary fields within an expression shape

Home Page Forums BizTalk 2004 – BizTalk 2010 How to handle base64Binary fields within an expression shape

Viewing 1 reply thread
  • Author
    Posts
    • #22927

      My input message has a base64Binary “contents” field.  I need to “pull it off” of the message and hand it to a C# function for processing.  Can someone give me an example of the expression shape code needed to handle this “contents” field as a regular string?

      It’s my intent to lift the “contents” field (as a string), pass it to the C# function, and then deal with the base64Binary conversion there. 

      My initial attempt (as follows) fails with an “InvalidOperationException”…

      workString = xpath(inputMsg,  “/*[local-name()=’submitDocument’ and namespace-uri()=’urn:mxdServices’]/*[local-name()=’contents’ and namespace-uri()=”]”);

    • #22931

      Was the exception raised by the xpath() operation or by the code you’re calling? Have you checked that the xpath is correct and is only returning a single node (you might need to do a string() in there to ensure it)?

      Other than that, it should be fairly straightforward, as your C# code can simply call Convert.FromBase64String() to convert the base64 content into a byte array.

       

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.