BizTalk Server Orchestration - Constructing general xml document in orchestration

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > January 2005 > Constructing general xml document in orchestration





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Constructing general xml document in orchestration
Bill

2005-01-14, 5:49 pm

Hi,

I am trying to build a orchestration that receives an xml document, where
one node contains antoher encoded xml document (which i know little about).
I would like to decode the node and create an xml document, which is sent
out of BizTalk.
I have built an orchestration that receives the document (and I have a
schema for it) the message is passed on to a construct message shape
containing a message assignment shape with the following code:

encoding = new System.Text.UTF8Encoding();
signedMessage = new System.Xml.XmlDocument();
encodedMessage = UUEnvelope;
signedMessage.LoadXml(encoding.GetString(System.Convert.FromBase64String(encodedMessage.LastChild.LastChild.InnerXml)));
System.Diagnostics.Debug.WriteLine("signed message
loaded!\n"+signedMessage.OuterXml);
XMLdoc = signedMessage;
System.Diagnostics.Debug.WriteLine("signed message assigend to XMLdoc");

This does not work (surprise!). When the execution reaches the message
assignment shape I get this error message:

Uncaught exception terminated service
myProject.SendDirect(c9d6b52d-42c6-9292-d710-6686eb531757), instance
10ebaf7d-50aa-42a4-96f6-15a78f1b2f12

The root element is missing.

Exception type: XmlException
Source: System.Xml
Target Site: Boolean Read()
Help Link:
Additional error information:

The message type for message XMLdoc is System.Xml.XmlDocument. The output of
the construct message is passed on to a send shape the sends the message to a
post of type file. The pipeline is
'Microsoft.BizTalk.DefaultPipelines.PassThruTransmit' so no validation as I
do not have any thing to validate against.

Can some one pls point out the error. Is it not possible to specify that
something is a xml document (and nothing further) and then route it through
BizTalk.

Best regards,

Bill

Ruslan Yakushev [MSFT]

2005-01-14, 8:46 pm

I think orchestration language does not allow this type of assingments:

XMLdoc = signedMessage; // where the signedMessage is of type XmlDocument

What you can do instead is to create a serializable .NET class with one
method that takes as an input an XLANGMessage object and then writes the
XML data into it. Something like this:

public XLANGMessage SaveXmlToXLANGMessage(XLANGMessage msg)
{
XMLDocument xmlDoc = new XmlDocument();

// Initialize your Xml document here and set its content.

XLANGPart p = msg[0];
p.LoadFrom(xmlDoc);

return msg;
}

Then invoke this method from the message assignment shape:

XMLdoc = MyClass.SaveXmlToXLANGMessage(receivedMessage);

--------------------
>Thread-Topic: Constructing general xml document in orchestration
>thread-index: AcT6SvwCDGY/Yz6SRPK+m/S1++/AKA==
>X-WBNR-Posting-Host: 194.192.21.238
>From: "=?Utf-8?B?QmlsbA==?=" <Bill@discussions.microsoft.com>
>Subject: Constructing general xml document in orchestration
>Date: Fri, 14 Jan 2005 07:09:03 -0800
>Lines: 48
>Message-ID: <EEA058C8-B150-416C-9B40-9A0BD271C83A@microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.biztalk.orchestration
>NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
>Path:

cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA0
3.phx.gbl
>Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.orchestration:9778
>X-Tomcat-NG: microsoft.public.biztalk.orchestration
>
>Hi,
>
>I am trying to build a orchestration that receives an xml document, where
>one node contains antoher encoded xml document (which i know little about).
>I would like to decode the node and create an xml document, which is sent
>out of BizTalk.
>I have built an orchestration that receives the document (and I have a
>schema for it) the message is passed on to a construct message shape
>containing a message assignment shape with the following code:
>
>encoding = new System.Text.UTF8Encoding();
>signedMessage = new System.Xml.XmlDocument();
>encodedMessage = UUEnvelope;

signedMessage.LoadXml(encoding.GetString(System.Convert.FromBase64String(enc
odedMessage.LastChild.LastChild.InnerXml)));
>System.Diagnostics.Debug.WriteLine("signed message
>loaded!\n"+signedMessage.OuterXml);
>XMLdoc = signedMessage;
>System.Diagnostics.Debug.WriteLine("signed message assigend to XMLdoc");
>
>This does not work (surprise!). When the execution reaches the message
>assignment shape I get this error message:
>
>Uncaught exception terminated service
>myProject.SendDirect(c9d6b52d-42c6-9292-d710-6686eb531757), instance
>10ebaf7d-50aa-42a4-96f6-15a78f1b2f12
>
>The root element is missing.
>
>Exception type: XmlException
>Source: System.Xml
>Target Site: Boolean Read()
>Help Link:
>Additional error information:
>
>The message type for message XMLdoc is System.Xml.XmlDocument. The output

of
>the construct message is passed on to a send shape the sends the message

to a
>post of type file. The pipeline is
>'Microsoft.BizTalk.DefaultPipelines.PassThruTransmit' so no validation as

I
>do not have any thing to validate against.
>
>Can some one pls point out the error. Is it not possible to specify that
>something is a xml document (and nothing further) and then route it

through
>BizTalk.
>
>Best regards,
>
>Bill
>
>


This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com