|
Home > Archive > BizTalk Server Orchestration > June 2006 > problem initializing a message from 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 |
problem initializing a message from an XmlDocument
|
|
| rnorthedge@hotmail.com 2006-06-12, 1:18 pm |
| I have an external web service that has a single string input parameter
and returns a string result. The web service expects the strings to
contain XML data that conforms to a particular schema (call it
mySchema). No, I didn't design the web service.
Anyway, in my Biztalk 2004 orchestration I have a message myMessageIn
of type mySchema. To pass its contents in as a string to the web
service, I am using an XmlDocument variable like this:
myXmlDoc = myMessageIn;
myWSRequest.RequestString = myXmlDoc.OuterXml;
This works OK, but when I try and do the same thing in reverse for the
result of the web service, like so:
myXmlDoc.LoadXml(myWSResponse.ResultString);
myMessageOut = myXmlDoc;
I get an error: Cannot implicitly convert type 'System.Xml.XmlDocument'
to 'Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy'.
Now: myMessageIn is an inbound parameter of the orchestration (I'm
trying to encapsulate this web service call with its crazy string
manipulation into a callable orchestration), so I understand that
beneath the covers it is using the XmlDocumentSerializationProxy class.
However, myMessageOut is currently just a normal message in the
orchestration, not an inbound or an outbound parameter, so I don't see
why it would be using XmlDocumentSerializationProxy.
Anyway, how can I use the XML from the string myWSResponse.ResultString
to construct myMessageOut?
Any help greatly appreciated,
Richard
| |
| Sujesh 2006-06-13, 7:22 am |
| This link might solve the problem.
http://martijnh.blogspot.com/2005_0...nh_archive.html
"rnorthedge@hotmail.com" wrote:
> I have an external web service that has a single string input parameter
> and returns a string result. The web service expects the strings to
> contain XML data that conforms to a particular schema (call it
> mySchema). No, I didn't design the web service.
>
> Anyway, in my Biztalk 2004 orchestration I have a message myMessageIn
> of type mySchema. To pass its contents in as a string to the web
> service, I am using an XmlDocument variable like this:
>
> myXmlDoc = myMessageIn;
> myWSRequest.RequestString = myXmlDoc.OuterXml;
>
> This works OK, but when I try and do the same thing in reverse for the
> result of the web service, like so:
>
> myXmlDoc.LoadXml(myWSResponse.ResultString);
> myMessageOut = myXmlDoc;
>
> I get an error: Cannot implicitly convert type 'System.Xml.XmlDocument'
> to 'Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy'.
>
> Now: myMessageIn is an inbound parameter of the orchestration (I'm
> trying to encapsulate this web service call with its crazy string
> manipulation into a callable orchestration), so I understand that
> beneath the covers it is using the XmlDocumentSerializationProxy class.
> However, myMessageOut is currently just a normal message in the
> orchestration, not an inbound or an outbound parameter, so I don't see
> why it would be using XmlDocumentSerializationProxy.
>
> Anyway, how can I use the XML from the string myWSResponse.ResultString
> to construct myMessageOut?
>
> Any help greatly appreciated,
>
> Richard
>
>
| |
| Sujesh 2006-06-13, 7:22 am |
| I am assuming your callable orch have an output parameter to the calling orch.
There might be a type mismatch there.
"rnorthedge@hotmail.com" wrote:
> I have an external web service that has a single string input parameter
> and returns a string result. The web service expects the strings to
> contain XML data that conforms to a particular schema (call it
> mySchema). No, I didn't design the web service.
>
> Anyway, in my Biztalk 2004 orchestration I have a message myMessageIn
> of type mySchema. To pass its contents in as a string to the web
> service, I am using an XmlDocument variable like this:
>
> myXmlDoc = myMessageIn;
> myWSRequest.RequestString = myXmlDoc.OuterXml;
>
> This works OK, but when I try and do the same thing in reverse for the
> result of the web service, like so:
>
> myXmlDoc.LoadXml(myWSResponse.ResultString);
> myMessageOut = myXmlDoc;
>
> I get an error: Cannot implicitly convert type 'System.Xml.XmlDocument'
> to 'Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy'.
>
> Now: myMessageIn is an inbound parameter of the orchestration (I'm
> trying to encapsulate this web service call with its crazy string
> manipulation into a callable orchestration), so I understand that
> beneath the covers it is using the XmlDocumentSerializationProxy class.
> However, myMessageOut is currently just a normal message in the
> orchestration, not an inbound or an outbound parameter, so I don't see
> why it would be using XmlDocumentSerializationProxy.
>
> Anyway, how can I use the XML from the string myWSResponse.ResultString
> to construct myMessageOut?
>
> Any help greatly appreciated,
>
> Richard
>
>
| |
| rnorthedge@hotmail.com 2006-06-13, 7:22 am |
|
Sujesh wrote:
> This link might solve the problem.
>
> http://martijnh.blogspot.com/2005_0...nh_archive.html
>
>
> "rnorthedge@hotmail.com" wrote:
>
Hi Sujesh,
Thanks for your reply. Yes, I saw the link you referenced before I
posted, but in Martijn's blog post, the orchestration has generic
parameters eg. of type XmlDocument, whereas my input parameter is a
message of type mySchema.
His post also seems to be referring to a scenario where the called
orchestration is in a separate assembly, whereas mine is in the same
assembly as the orchestrations that call it. (Well, if it worked, that
is.)
Richard
| |
| Sujesh 2006-06-14, 1:19 am |
| Is your mymessageout of type XmlDocument or does it have a message
type(namespace#rootnode?
Also does mymessageout defined inside called orchestration or calling
orchestration?
"rnorthedge@hotmail.com" wrote:
>
> Sujesh wrote:
> Hi Sujesh,
>
> Thanks for your reply. Yes, I saw the link you referenced before I
> posted, but in Martijn's blog post, the orchestration has generic
> parameters eg. of type XmlDocument, whereas my input parameter is a
> message of type mySchema.
>
> His post also seems to be referring to a scenario where the called
> orchestration is in a separate assembly, whereas mine is in the same
> assembly as the orchestrations that call it. (Well, if it worked, that
> is.)
>
> Richard
>
>
| |
| rnorthedge@hotmail.com 2006-06-16, 1:23 pm |
| Hi,
Thanks for getting back to me.
Sujesh wrote:
> Is your mymessageout of type XmlDocument or does it have a message
> type(namespace#rootnode?
It has a message type - the same message type as myMessageIn (a type of
mySchema).
> Also does mymessageout defined inside called orchestration or calling
> orchestration?
It's declared as a variable inside the orchestration. Ideally, I'd like
it to be an out parameter, but I can live without that - I can pass a
string back rather than the message, if necessary. But I do need to
convert the string returned from the web service into a message type of
mySchema, so I can do some processing on it. The only way I could see
of getting the string converted into a message is via an XmlDocument,
as I wrote in my original post:
myXmlDoc.LoadXml(myWSResponse.ResultString); // myXmlDoc is an
XmlDocument variable
myMessageOut = myXmlDoc;
but the second line of this is giving me the SerializationProxy error.
Richard
| |
| Sujesh 2006-06-18, 1:18 am |
| I have tried to replicate the exact same scenario in my dev environment and
it didn't give me any error. It worked fine for me.
If you dont mind sending me the project or files, I can have a look and see
if there is something missing.
you can send me on skodoth@apl.co.nz
Are you using BTS2006 or BTS2004?
"rnorthedge@hotmail.com" wrote:
> Hi,
>
> Thanks for getting back to me.
>
> Sujesh wrote:
>
> It has a message type - the same message type as myMessageIn (a type of
> mySchema).
>
>
> It's declared as a variable inside the orchestration. Ideally, I'd like
> it to be an out parameter, but I can live without that - I can pass a
> string back rather than the message, if necessary. But I do need to
> convert the string returned from the web service into a message type of
> mySchema, so I can do some processing on it. The only way I could see
> of getting the string converted into a message is via an XmlDocument,
> as I wrote in my original post:
>
> myXmlDoc.LoadXml(myWSResponse.ResultString); // myXmlDoc is an
> XmlDocument variable
> myMessageOut = myXmlDoc;
>
> but the second line of this is giving me the SerializationProxy error.
>
>
> Richard
>
>
| |
| rnorthedge@hotmail.com 2006-06-20, 7:20 am |
| I have tried a simpler scenario on a separate development server and it
seems to compile OK. I think I need to start building another
orchestration up from scratch on the same machine as the problem
orchestration and seeing at what point it breaks.
It's BTS2004, by the way.
Cheers,
Richard
Sujesh wrote:
> I have tried to replicate the exact same scenario in my dev environment and
> it didn't give me any error. It worked fine for me.
>
> If you dont mind sending me the project or files, I can have a look and see
> if there is something missing.
>
> you can send me on skodoth@apl.co.nz
>
> Are you using BTS2006 or BTS2004?
>
|
|
|
|
|