0

I'm trying to call a receive pipeline from the orchestration in order to catch any type of flatfile_to_xml error.

After searching for tutorials, the process seemed quite easy. Added the libraries, created my inputMsg of type xmlDocument to inglobe any non-Xml payload (in my case the content of my file.txt) and created an atomic scope containing an expression for:

  Microsoft.XLANGs.Pipeline.XLANGPipelineManager
     .ExecuteReceivePipeline(typeof(namespace.pipelineName), msgIN);

Too bad I get that ExecuteReceivePipeline can't accept a XmlDocument while it accepts only a Microsoft.XLANGs.BaseType.XLANGMessage).

Cannot connvert from 'System.Xml.XmlDocument' to 'Microsoft.XLANGs.BaseTypes.XLANGMEssage'

Why this, and how can I achieve what I'm trying to achieve?

Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
strongmmc
  • 137
  • 12
  • Why do you need to do this in an Orchestration? Just have the pipeline on the port and set routing for failed messages on. Then subscribe to failed messages to process those that failed – Dijkgraaf Dec 08 '16 at 00:25
  • Because i'm asked to produce a new file to be sent to a second dir. File contains the exception details, the stage of the processing (the scope, to be clear) and the original msg (the text content) so that the company that sent the file can compare the cause of the fault with the original faulted message and send a new corrected one. From the classic pipeline i can only subscribe to the messageType of the flat file and save that, can't do it with the exception details. If i could i would still end up with separated msgs. – strongmmc Dec 08 '16 at 01:31

2 Answers2

0

You have to use a Message variable of type XmlDocument.

It look like you're using a variable of type XmlDocument.

Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
Johns-305
  • 10,908
  • 12
  • 21
  • This is not the case. I **started** using a Message of type XmlDocument **and** obtained the error in first place. I'm now using a Msg with a message part of type XmlDocument, because (i didn't know this) a Msg essentially IS a XLANGMessage wrapping a multipart of any type, including XmlDocument. My orchestration now works if i don't try to catch any kind of pipeline error, otherwise i receive an XmlException of type _Data at the root level is invalid. Line 1, position 1_ – strongmmc Dec 12 '16 at 08:49
0

Ok, now it's working and i'm not sure why. At first the msgIN of type XmlDocument wasn't accepted as a valid parameter. I then created a msgType of type XmlDocument, and assigned it as the type of the message, so that calling:

ExecuteReceivePipeline(typeof(namespace.pipelineName), msgIN)

would be valid. after many rebuild and deploy i switched back to msgIn as XmlDocument... and it worked as intended...

I don't get it, but it's not the first time that a rebuild or a close-and-reopen of VS solved my preblems. Thanks for those who found the time to answer!

strongmmc
  • 137
  • 12