Send Initializing Message As Base64Binary MTOM Attachment

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Send Initializing Message As Base64Binary MTOM Attachment

Viewing 0 reply threads
  • Author
    Posts
    • #18141

       Here's my situation.

      I have an orchestration which is initialized by an XML message received via the file adapter.  That file needs to be sent to a web service which accepts the entire initializing XML document as a base64binary attachment.

      In .Net I would simply convert the XMLDocument to a byte array and set the generated class member to that byte array.  In BTS it does not seem to be so simple.

      I have noticed that other developers have attached images and other documents within scripting functoids by reading a file from the file system, converting the data to a base64 byte array, and mapping the output to the destination schema's base64binary element.  Is there a way to similarlly accomplish this by having the scripting functoid accept the entire source xml doc as input?

      Here is the schema I am trying to map to:

      <?xml version="1.0" encoding="utf-16"?>

      <xs schema xmlns:tns="http://www.w3.org/2005/05/xmlmime&quot; xmlns:b="http://schemas.microsoft.com/BizTalk/2003&quot; elementFormDefault="qualified" targetNamespace="http://www.w3.org/2005/05/xmlmime&quot; xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;

      <xs:element name="base64Binary" nillable="true" type="tns:base64Binary" />

      <xs:complexType name="base64Binary">

      <xs simpleContent>

      <xs:extension base="xs:base64Binary">

      <xs:attribute form="qualified" name="contentType" type="xs string" />

      </xs:extension>

      </xs simpleContent>

      </xs:complexType>

      </xs schema>

      <xs schema xmlns:tns="http://www.w3.org/2005/05/xmlmime&quot; xmlns:b="http://schemas.microsoft.com/BizTalk/2003&quot; elementFormDefault="qualified" targetNamespace="http://www.w3.org/2005/05/xmlmime&quot; xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;

      <xs:element name="base64Binary" nillable="true" type="tns:base64Binary" />

      <xs:complexType name="base64Binary">

      <xs simpleContent>

      <xs:extension base="xs:base64Binary">

      <xs:attribute form="qualified" name="contentType" type="xs string" />

      </xs:extension>

      </xs simpleContent>

      </xs:complexType>

      </xs schema>

       

      I tried referencing a helper .NET class in the orchestration, promoting the base64binary element, and setting the value within a message assignment, but I got a strange error saying I could not implicitly convert a System.Byte[] to a System.Byte[].  How do I set the base64binary element to the byte[] returned from the helper method?

      Any help would be greatly appreciated!

      Russell

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