BizTalk Server Orchestration - Sending An Entire Message to a Web Service as an Argument

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > December 2004 > Sending An Entire Message to a Web Service as an Argument





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 Sending An Entire Message to a Web Service as an Argument
Biff

2004-12-12, 6:26 pm

I would like to call a web service from an orchestration and send the
XML of an entire message as a string element in the web service request
message rather than copying a couple promoted values from one message
to the web service request message. Is there a way to assign the text
of the message to a variable that can be sent as an argument? There's
no defined schema for the message that goes to the web service, as it
fronts a service that takes different actions depending on the type of
message that it receives.

Conversely, when I receive a string back from the web service, I would
like to assign it to a message?

Every sample I have found to date just sends atomic values (promoted
values from within messages) to web services rather than an entire
message.

Thanks in advance for any help you can provide,
Biff Gaut
Gaithersburg, MD

Biff

2004-12-12, 6:26 pm

To add a little more detail, here's the signature of the web service I
am calling-

string result = validate( String lineOfBusinessId, String asOf, boolean
isStrict, string xmlData )

My goal is to send an existing message in the orchestration as xmlData
and assign result to a new message with a defined schema when the
service returns.

Thanks,
Biff Gaut
Gaithersburg, MD

Hugo Rodger-Brown

2004-12-13, 8:26 am

Biff - if the argument defined in the web service is a string, as shown, you
should be able to set its value in a Message Assignment shape (within a
Construct shape). When you add the web reference to the project, you will
get a schema for the web service request, and you'll have to add a message
to the orchestration with this schema type (as per the standard
documentation for "Consume a web service". In your example, as the schema
consists of only primitive data types, you'll have to create the message in
a Assignment shape, not a Transform.

To get the string, you'll have to do the following.
1. Add a new variable to the orchestration of type System.Xml.XmlDocument.
2. Initialise this variable (in an Expression):
myVar = new System.Xml.XmlDocument;
myVar = myMsg;
(You can do this because all messages are XmlDocuments.)

3. You now have a copy of your message, cast as an XmlDocument, which means
that you can now use the XmlDocument.OuterXml property:
myWebRequestMsg.lineOfBusinessId = "1";
myWebRequestMsg.asOf = "now";
myWebRequestMsg.isStrict = true;
myWebRequestMsg.xmlData = myVar.OuterXml;

I'm saying all this without testing it - so it may not work exactly how I've
described, but I think it should work.

Hugo
http://hugo.rodger-brown.com

"Biff" <biff_gaut@hotmail.com> wrote in message
news:1102889303.243229.45270@z14g2000cwz.googlegroups.com...
> To add a little more detail, here's the signature of the web service I
> am calling-
>
> string result = validate( String lineOfBusinessId, String asOf, boolean
> isStrict, string xmlData )
>
> My goal is to send an existing message in the orchestration as xmlData
> and assign result to a new message with a defined schema when the
> service returns.
>
> Thanks,
> Biff Gaut
> Gaithersburg, MD
>



Biff

2004-12-13, 8:26 am

Hugo,

This worked great! Thanks for the quick response. I haven't tried the
converse (taking a string and assigning it to a message), but I'm
thinking it will use the exact same steps in reverse.
Biff Gaut
Gaithersburg, MD

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com