locked
How to catch invalid XML inside orchestration RRS feed

  • Question

  • I have an Passthrough Pipeline and passing an invalid XML , I am unable to capture inside an orcestration.

    I get the error -

    The published message could not be routed because no subscribers were found.

    If i pass valid XML orchestration picks up and process it.    Is there any way to capture this in orchestration

    Regards

    Suresh

    Wednesday, March 18, 2015 11:37 AM

Answers

  • Hi Suresh, 

    Just a followup- did you got your answer?

    If not please read my answer again. If you want to receive invalid xml in orchestration make the first receive shape message untyped i.e. XMLDocument

    Let us know if you have any further question.


    Thanks,
    Prashant
    ----------------------------------------
    Please mark this post accordingly if it answers your query or is helpful.

    • Marked as answer by s u r e s h Saturday, March 21, 2015 6:31 AM
    Thursday, March 19, 2015 2:30 PM

All replies

  • If you want your Orchestration to catch everything from a Receive Port, even invalid stuff, you need to specify your input message type in the Orchestration as XMLDocument.

    This will cause the Orchestration to subscribe to:

    ReceivePortID == [Port ID]

    instead of:

    ReceivePortID == [Port ID] and MessageType == [some message type]

    Be aware though, although you can pass invalid XML into this XMLDocument, you cannot use it for anything, expect passing it to an external assembly (as the inside of BizTalk always expects XML).

    Morten la Cour

    Wednesday, March 18, 2015 11:40 AM
  • You have a receive location with pass-thru pipeline. When you drop a valid-XML message, your Orchestration receive the message. When you drop an invalid-XML, you’re not able to receive the message in orchestration. Confusing.

    When Orchestration can process a message when you have a pass-thru means, in your Orchestration’s receive shape is bound to a message of type XMLDocument. Here XMLDocument type message defined in Orchestration would have acted just act as “container” for received message. The received message’s content in passed just as stream and received message’s Document Object Model  in not loaded into XML message, because you have used pass-thru pipeline. So when you dropped a message it would have “Received” by orchestration and would have failed during furture processing (if you have tried to access the content of the invalid XML. Check ii correctly.

    Regards,

    M.R.Ashwin Prabhu


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    Wednesday, March 18, 2015 1:02 PM
  • I believe your orchestration will have a Typed Schema, therefore the subscription of Orchestration will be as below-

    ReceivePortID == [Port ID] and MessageType == [MessageType of your msg at first Receive Shape]

    So when you are using XML Receive Pipeline it promotes the MessageType element in the incoming message which helps in satisfying the above filter.

    However if you use PassThrough pipeline it doesn't touches the incoming message at all and thus no MessageType was not promoted so the above filter condition is not met.

    If you want to receive Untyped Message in Orchestration you will have to create a msg of type System.XML.XMLDocument and assign it to first receive shape.

    This will generate filter condition as- ReceivePortID == [Port ID], without MessageType, which will allow orchestration to subscribe your message


    Thanks,
    Prashant
    ----------------------------------------
    Please mark this post accordingly if it answers your query or is helpful.

    Wednesday, March 18, 2015 5:44 PM
  • Hi Ashwin

    My Receive shape is bound to a schema so if i try to pass any other XML(i call that as Invalid XML) it does not go inside the orchestration.

    When i  replicated as informed by la Cour i could get the exception but not sure why the other way i could not

    Regards

    Suresh


    • Edited by s u r e s h Wednesday, March 18, 2015 5:47 PM
    Wednesday, March 18, 2015 5:45 PM
  • Please reread laCour's post.  He explains that using a typed schema adds the MessageType to the Orchestration Port's filter.  The MessageType is set by the XmlDisassembler.
    Wednesday, March 18, 2015 6:03 PM
    Moderator
  • Hi Suresh, 

    Just a followup- did you got your answer?

    If not please read my answer again. If you want to receive invalid xml in orchestration make the first receive shape message untyped i.e. XMLDocument

    Let us know if you have any further question.


    Thanks,
    Prashant
    ----------------------------------------
    Please mark this post accordingly if it answers your query or is helpful.

    • Marked as answer by s u r e s h Saturday, March 21, 2015 6:31 AM
    Thursday, March 19, 2015 2:30 PM