Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Call Send Pipeline that converts XML to FlatFile (String) in Orch
- This topic has 4 replies, 1 voice, and was last updated 9 years, 5 months ago by
community-content.
-
AuthorPosts
-
-
June 2, 2010 at 12:58 PM #24866
We’ve been trying to call a Send Pipeline that converts XML to a string, and then access the string value.
The reason is that we want to save the XML and the flat file in an audit trail database as proof of what was sent to a vendor. We need to store it in a specific table along with several tracking GUIDs. We want to store both the XML (for readability) and the flat-file as a string (for audit-ability).
Here is our expression shape contents:
xlangmsgInput.Add(msgFtrReq); // msgFtrReq is the XMLmessage
msgxmlxlang=null; // ideally, this will be the text/string messageMicrosoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteSendPipeline(
typeof(WireFtrReqSend_type),xlangmsgInput, msgxmlxlang);When we define msgxmlxlang as a message of System.Xml.Xmldocument, then pipeline runs and we get an error in the following shape where we try to debug and show the value of the string:
Description:
Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ‘FRB.EC.WireTransfer.BizTalk.Artifacts.ProcessWireTransfer(214ef0f5-f3cb-9808-66f5-10a0ff4fefed)’.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: d1334478-a344-46ed-b2d8-c610a33fdc18
Shape name: Debug 3017
ShapeId: 9a2ec9f7-1fd6-42c5-b66f-253e9d144f73
Exception thrown from: segment 2, progress 15 Inner exception: Data at the root level is invalid. Line 1, position 1.
Exception type: XmlException
Source: System.Xml
Target Site: Void Throw(System.Exception) The following is a stack trace that identifies the location where the exception occuredat System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(TextReader txtReader)
at Microsoft.XLANGs.RuntimeTypes.XmlHelpers.XmlDocumentFromStream(Stream s)
at Microsoft.XLANGs.Core.Value.GetXmlDocument()
at Microsoft.XLANGs.Core.Value.RetrieveAs(Type t)
at Microsoft.XLANGs.Core.Part.ProtectedRetrieveAs(Type t)
at Microsoft.XLANGs.Core.Part.RetrieveAs(Type t)
at Microsoft.XLANGs.Core.Part.get_XmlDocument()
at Microsoft.XLANGs.Core.XSDPart.get_TypedValue()
at FRB.EC.WireTransfer.BizTalk.Artifacts.ProcessWireTransfer.segment2(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)HOWEVER, if we make the message passed to the pipeline component a message of type System.String then the we blow up in running the pipeline:
Exception thrown from: segment 2, progress 10 Inner exception: There was a failure executing pipeline “FRB.EC.WireTransfer.BizTalk.Artifacts.WireFtrReqSend_type”. Error details: “There is an error in XML document (1, 1).”.
Exception type: XLANGPipelineManagerException
Source: Microsoft.XLANGs.Pipeline
Target Site: Void ExecutePipeline(Microsoft.BizTalk.PipelineOM.SendPipeline, Microsoft.XLANGs.Pipeline.SendPipelineInputMessages, Microsoft.XLANGs.BaseTypes.XLANGMessage)
The following is a stack trace that identifies the location where the exception occuredat Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecutePipeline(SendPipeline p, SendPipelineInputMessages inMessages, XLANGMessage outMsg)
at Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteSendPipeline(Type sendPipelineType, SendPipelineInputMessages inMessages, XLANGMessage outXLANGMsg)
at FRB.EC.WireTransfer.BizTalk.Artifacts.ProcessWireTransfer.segment2(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp) Additional error information:There is an error in XML document (1, 1).
Exception type: InvalidOperationException
Source: System.Xml
Target Site: System.Object Deserialize(System.Xml.XmlReader, System.String, System.Xml.Serialization.XmlDeserializationEvents)
The following is a stack trace that identifies the location where the exception occuredat System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader)
at Microsoft.XLANGs.RuntimeTypes.XmlHelpers.ObjectFromStreamReader(StreamReader sr, Type t)
at Microsoft.XLANGs.RuntimeTypes.XmlHelpers.ObjectFromStream(Stream s, Type t)
at Microsoft.XLANGs.Core.Value.GetObject(Type t)
at Microsoft.XLANGs.Core.DotNetPart.ProtectedLoadFrom(Object source)
at Microsoft.XLANGs.Core.Part.LoadFrom(Object source)
at Microsoft.XLANGs.Core.PartWrapperForUserCode.LoadFrom(Object source)
at Microsoft.XLANGs.Pipeline.PipelineBMessage.AddBaseMessagePart(XLANGMessage xmsg, IBaseMessagePart bpart, String partName, Int32 partIndex, Boolean addNewPart)
at Microsoft.XLANGs.Pipeline.PipelineBMessage.ToXLANGMessage(XLANGMessage inxmsg)
at Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecutePipeline(SendPipeline p, SendPipelineInputMessages inMessages, XLANGMessage outMsg) Additional error information:Data at the root level is invalid. Line 1, position 1.
Exception type: XmlException
Source: System.Xml
Target Site: Void Throw(System.Exception) The following is a stack trace that identifies the location where the exception occuredat System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlReader.MoveToContent()
at System.Xml.Serialization.XmlSerializationPrimitiveReader.Read_string()
at System.Xml.Serialization.XmlSerializer.DeserializePrimitive(XmlReader xmlReader, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)We also tried changing this line of code:
from: msgxmlxlang=null; // ideally, this will be the text/string message
to: msgxmlxlang=”<root />”; // in order to give up some good XML
Any ideas appreciated.
Neal Walters
-
June 15, 2010 at 2:53 AM #24963
Do you have any idea now?
-
June 21, 2010 at 12:25 AM #25022
I experience exactly the same problem. If you found a solution – please share with people.
-
July 1, 2010 at 2:55 AM #25107
I had the same requirement, I did a blog post on how I did it:
http://www.deves.net/blog/post/Execute-Send-Pipeline-In-Orchestration-Retrieve-String.aspx
John
-
October 14, 2014 at 12:00 PM #26460
The link is broken pleaseeeeeeee share you solution
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.