Sending An Entire Message to a Web Service as an Argument
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server Orchestration > Sending An Entire Message to a Web Service as an Argument




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Sending An Entire Message to a Web Service as an Argument  
Biff


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-12-04 11: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






[ Post a follow-up to this message ]



    Re: Sending An Entire Message to a Web Service as an Argument  
Biff


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-12-04 11: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






[ Post a follow-up to this message ]



    Re: Sending An Entire Message to a Web Service as an Argument  
Hugo Rodger-Brown


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-13-04 01:26 PM

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
>







[ Post a follow-up to this message ]



    Re: Sending An Entire Message to a Web Service as an Argument  
Biff


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-13-04 01:26 PM

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






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:00 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register