converting a string into xml document in msg assignment shape

Home Page Forums BizTalk 2004 – BizTalk 2010 converting a string into xml document in msg assignment shape

Viewing 2 reply threads
  • Author
    Posts
    • #22038

      Hi I have scenerio where I am calling a .NET component and which returns a ‘ex.Message’ as a string if there is an error connecting to SQL, so when it returns I need to catch that string and I need to send it as msg to the SMTP port , I need to convert that string into Msg of xml document and send it as an e-mail notification.  How can I acheive this.

       

      Thanks 

    • #22057

      I assume, you use an orchestration to call the .NET component.

      In the orchestration create a variables: varXmlDocument of type System.Xml.XmlDocument, varXmlString of type System.String.
      In an expression shape add:

      // Get an XML string
      varXmlString = Call.your.Net.component.here()

      In a message assignment shape add:

      // Create an XML document
      varXmlDocument = new System.Xml.XmlDocument();
      varXmlDocument.LoadXml(varXmlString);

      // Set notification message body
      msgNotification.Body = varXmlDocument;

      I reckon, you will also add a decide shape to check your varXmlString includes an error description.

      Regards,

    • #44921
      Denzel

        Here someone is talking about converting a string into xml document in msg assignment shape as you can see and learn through here. Just try best online writing services for them. I personally don’t have any idea bout it so if anyone knows anything then kindly explain it to me as well.

    Viewing 2 reply threads
    • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.