|
Home > Archive > BizTalk Server Orchestration > September 2004 > Assign a Message to an XmlDocument
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 |
Assign a Message to an XmlDocument
|
|
| Norman Chen 2004-09-11, 7:48 am |
| Dear All:
In my orchestration, I have two variables and one message. One variable is
named xmlDoc and it's type is System.Xml.XmlDocument. Another variable is
named xmlString and it's type is String. The message is named IncomeInstance
and it's type is IncomeSchema. Now, I want to convert the IncomeInstance to
xmlString, so I use the "Expression" shape. The expression is:
xmlDoc = IncomeInstance;
xmlString = xmlDoc.OuterXml;
When I use the HAT for debugging, I set a breakpoint after the Expression
shape. After the Expression shape, I found:
1. The value of xmlDoc is null.
2. The value of xmlString is null.
But the Part Value of IncomeInstance is as expected.
I have no idea why the values of the variables are null, please help me,
tanks a lot!
| |
| Nabeel Prior 2004-09-11, 7:48 am |
| Try
xmlDoc = (System.Xml.XmlDocument)IncomeInstance;
--
Kind Regards,
Nabeel Prior
"Norman Chen" <NormanChen@discussions.microsoft.com> wrote in message
news:609BD223-FBBA-4FCF-B02E-C7539D1D2905@microsoft.com...
> Dear All:
> In my orchestration, I have two variables and one message. One variable
> is
> named xmlDoc and it's type is System.Xml.XmlDocument. Another variable is
> named xmlString and it's type is String. The message is named
> IncomeInstance
> and it's type is IncomeSchema. Now, I want to convert the IncomeInstance
> to
> xmlString, so I use the "Expression" shape. The expression is:
>
> xmlDoc = IncomeInstance;
> xmlString = xmlDoc.OuterXml;
>
> When I use the HAT for debugging, I set a breakpoint after the Expression
> shape. After the Expression shape, I found:
> 1. The value of xmlDoc is null.
> 2. The value of xmlString is null.
> But the Part Value of IncomeInstance is as expected.
>
> I have no idea why the values of the variables are null, please help me,
> tanks a lot!
| |
| Norman Chen 2004-09-11, 5:47 pm |
| Hi, Nabeel Prior:
First, Thanks for your reply.
I have done, but it's no use.
"Nabeel Prior" wrote:
> Try
> xmlDoc = (System.Xml.XmlDocument)IncomeInstance;
>
> --
>
> Kind Regards,
>
> Nabeel Prior
> "Norman Chen" <NormanChen@discussions.microsoft.com> wrote in message
> news:609BD223-FBBA-4FCF-B02E-C7539D1D2905@microsoft.com...
>
>
>
| |
| Alan Smith 2004-09-13, 5:52 pm |
| Hi Norman,
What you are doing looks correct. Are you 100% sure that the IncomeInstance
message contains data? I have used this method lots of times, and not had a
problem with it. Also, you will get a null reference exception if you call
xmlDoc.OuterXml when xmlDoc is null.
Another top tip, you can also use System.Diagnostics.Debug.WriteLine
(xmlString); and attatch VisualStudio debugger to the BTSNTSvc.exe process,
to dump your XML data.
/Alan
"Norman Chen" wrote:
> Dear All:
> In my orchestration, I have two variables and one message. One variable is
> named xmlDoc and it's type is System.Xml.XmlDocument. Another variable is
> named xmlString and it's type is String. The message is named IncomeInstance
> and it's type is IncomeSchema. Now, I want to convert the IncomeInstance to
> xmlString, so I use the "Expression" shape. The expression is:
>
> xmlDoc = IncomeInstance;
> xmlString = xmlDoc.OuterXml;
>
> When I use the HAT for debugging, I set a breakpoint after the Expression
> shape. After the Expression shape, I found:
> 1. The value of xmlDoc is null.
> 2. The value of xmlString is null.
> But the Part Value of IncomeInstance is as expected.
>
> I have no idea why the values of the variables are null, please help me,
> tanks a lot!
| |
| Greg Forsythe 2004-09-15, 10:19 am |
| Try...
xmlDoc = new System.Xml.XmlDocument();
xmlDoc = IncomeInstance;
xmlString = xmlDoc.OuterXml;
"Norman Chen" wrote:
> Dear All:
> In my orchestration, I have two variables and one message. One variable is
> named xmlDoc and it's type is System.Xml.XmlDocument. Another variable is
> named xmlString and it's type is String. The message is named IncomeInstance
> and it's type is IncomeSchema. Now, I want to convert the IncomeInstance to
> xmlString, so I use the "Expression" shape. The expression is:
>
> xmlDoc = IncomeInstance;
> xmlString = xmlDoc.OuterXml;
>
> When I use the HAT for debugging, I set a breakpoint after the Expression
> shape. After the Expression shape, I found:
> 1. The value of xmlDoc is null.
> 2. The value of xmlString is null.
> But the Part Value of IncomeInstance is as expected.
>
> I have no idea why the values of the variables are null, please help me,
> tanks a lot!
| |
| Norman Chen 2004-09-15, 8:51 pm |
| Dear All:
xmlDoc = IncomeInstance;
xmlString = xmlDoc.OuterXml;
It is work, but just as I said before, xmlDoc and xmlString are null in HAT.
I found this truth after dumping xmlDoc and xmlString, so I feel that I have
been cheated by HAT.
Maybe there is something wrong when I use HAT.
Thank you all for your reply, thank you!
"Norman Chen" wrote:
> Dear All:
> In my orchestration, I have two variables and one message. One variable is
> named xmlDoc and it's type is System.Xml.XmlDocument. Another variable is
> named xmlString and it's type is String. The message is named IncomeInstance
> and it's type is IncomeSchema. Now, I want to convert the IncomeInstance to
> xmlString, so I use the "Expression" shape. The expression is:
>
> xmlDoc = IncomeInstance;
> xmlString = xmlDoc.OuterXml;
>
> When I use the HAT for debugging, I set a breakpoint after the Expression
> shape. After the Expression shape, I found:
> 1. The value of xmlDoc is null.
> 2. The value of xmlString is null.
> But the Part Value of IncomeInstance is as expected.
>
> I have no idea why the values of the variables are null, please help me,
> tanks a lot!
|
|
|
|
|