Biztalk 2004 Integration Experiences

Wednesday, April 06, 2005

Sending String messages from an Orchestration

Recently one of my colleague asked my help to send a message as "System.String" from an Orchestration. I thought it would be a simple one and did not understand why he needs my help to do this.

When I looked at it, I noticed that the string is wrapped as Xml . It was a little weird to me that in Biztalk 2004 that this cannot be done natively by just declaring as "System.String". Even Biztalk 2000 Xlang had the same kind of Xml Envelope for String, but it would remove that when the message is passed out.

After doing a little research I found that this is documented in the Biztalk 2004 Documentation under "Sending a Text E-Mail Message from an Orchestration". You can see it here

It specifically states that

"Sending a message of type System.String will not work, because the string gets formatted as an XML document in the message"

and tells you use a special class named "RawString" and the code is there in msdn.

As specified in the documentation, I took the code for "RawString" class, placed it in a dll, declared the message as type "RawString" and created an instance and passed in my string. It worked like a charm!

Post a comment if you would like the sample, I'll send you.

5 Comments:

  • At 4:44 AM, Anonymous Ric Pullen said…

    The sample shows hardcoded strings. I'm having trouble converting a returned string from a class (using a message enrichment process to call a tcpip socket) to the raw string any ideas how to convert it?

     
  • At 5:01 AM, Anonymous Ric Pullen said…

    DOH! Please ignore my previous post
    I'm an idiot.

    Why is it that you (almost) always find a solution after posting help.

     
  • At 11:29 AM, Blogger Deepak Lakshmanan said…

    no probs, it happens! let me know if you need any other help.

     
  • At 8:48 AM, Blogger PAVEL said…

    Hi!!!
    I read about BizTalk RawString option and I would be very appreciate if you would send your sample to me on psemenchuk@yahoo.com

     
  • At 6:42 AM, Anonymous Anonymous said…

    please post the dll sample

     

Post a Comment

<< Home