I have a map which builds me a message, which then gets passed to another map (all in an orchestration.

Inspecting the message output from the first map I can see that the message contains EF BB BF byte order marks.

When the 2nd map executes, it throws an exception "Data at the root level is invalid. Line 1, position 61.":

xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'MyCompany.MyOrchestration(004464ca-1c34-e342-591d-5e8182a4be18)'.
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: 62d99333-8dc4-4ca4-9e5b-7fdf8583e081 Shape name: conCDA
ShapeId: ba722b56-c115-4abb-b40c-211824369266
Exception thrown from: segment 1, progress 15
Inner exception: Data at the root level is invalid. Line 1, position 61.

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 occured

at 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.LoadDocSequence(XmlDocument parentDoc)
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.Core.Service.Transform.ShredXmlDocument(Stream inStream, Object[] outParams, String mapName, XmlDeclaration xmlDecl)
at Microsoft.XLANGs.Core.Service.ApplyInMemoryTransform(Type mapRef, TransformMetaData trfMetaData, Object[] outParams, Stream[] inStreams)
at Microsoft.XLANGs.Core.Service.ApplyTransform(Type mapRef, Object[] outParams, Object[] inParams)
at MyCompany.MyOrchestration.segment1(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)

How do I get the first map to not add the byte order markings?

Edit: The first map is a map that has two messages on the input side that map to a singme message out the output side. The first message maps all nodes using link by structure, and the second messages uses a mass copy functiod. I can't see any funny character at character 61, even when viewing the message at the byte level. I can see the BOM, which is why I was thinking that was the issue.

有帮助吗?

解决方案

I'm not entirely sure that this is a BOM issue - you have not made it clear how you are creating your map (i.e. do you have custom functiods, are you using XSLT etc.) Can you confirm what character is on (or around) character 61 - is it one of the Reserved Xml Markup Characters?

Alternatively, have you checked that the 1st map you invoke produces valid output when run using the 'Test Map' tool in VS Solution Explorer? Do you have the 'Validate TestMap Input' and 'Validate TestMap Output' options set to TRUE and it doesn't throw any errors? Also, have you tried saving the output from the 1st map test and using it as input to the 2nd map test?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top