none
exposing schema as web service and using it in orchestration RRS feed

  • Question

  • Hai,

    i have exposed schema as web service and write a client application for that service .

    i am able to receive data into the orchestration using direct binding( using receive port name filters).

    but i am receiving System.xml.xmldocument message type so i am unable to map this data to another schema.

    can any one help me.

    Thanks in advance.

    Friday, March 18, 2016 9:45 AM

Answers

  • You're receiving the data as System.Xml.XmlDocument because on the direct bound port you have not specified the MessageType as the schema you wish to receive.

    Open the orchestration, select the port type and under the operation in question select and assign the schemas you used when publishing the schemas as a service. DO the same for the response direct bound port.

    The other way is to use the message assignment shape in a message construct shape. You'd need the following code

    //
    // variable xmlMessage = System.Xml.XmlDocument
    // variable recdMessage = BizTalk Message
    // variable schemaBasedMessage = BizTalk Message
    //
    // assign the received message to a XMlDocument type
    xmlMessage = recdMessage;
    //
    // Now assign the XMLDocument to it to
    // the strongly typed message 
    schemaBasedMessage = xmlMessage;
    //
    // In case you want to copy all the properties
    schemaBasedMessage(*) = recdMessage(*);
    The simpler way would be to assign the correct message to the direct bound port within the orchestration.

    Regards.

    • Proposed as answer by sujith reddy komma Friday, March 18, 2016 11:32 AM
    • Marked as answer by Angie Xu Friday, March 25, 2016 1:49 AM
    Friday, March 18, 2016 10:38 AM
  • but i am receiving System.xml.xmldocument message type so i am unable to map this data to another schema.

    On the receive Operation in the Orchestration, you have to use a Message that has the correct Type for the incoming message.  Then you will be able to use it in a Transform Shape.

    Meaning, the received Message must have a Schema type to be used in a Map.

    • Marked as answer by Angie Xu Friday, March 25, 2016 1:48 AM
    Friday, March 18, 2016 1:34 PM
    Moderator

All replies

  • You're receiving the data as System.Xml.XmlDocument because on the direct bound port you have not specified the MessageType as the schema you wish to receive.

    Open the orchestration, select the port type and under the operation in question select and assign the schemas you used when publishing the schemas as a service. DO the same for the response direct bound port.

    The other way is to use the message assignment shape in a message construct shape. You'd need the following code

    //
    // variable xmlMessage = System.Xml.XmlDocument
    // variable recdMessage = BizTalk Message
    // variable schemaBasedMessage = BizTalk Message
    //
    // assign the received message to a XMlDocument type
    xmlMessage = recdMessage;
    //
    // Now assign the XMLDocument to it to
    // the strongly typed message 
    schemaBasedMessage = xmlMessage;
    //
    // In case you want to copy all the properties
    schemaBasedMessage(*) = recdMessage(*);
    The simpler way would be to assign the correct message to the direct bound port within the orchestration.

    Regards.

    • Proposed as answer by sujith reddy komma Friday, March 18, 2016 11:32 AM
    • Marked as answer by Angie Xu Friday, March 25, 2016 1:49 AM
    Friday, March 18, 2016 10:38 AM
  • when you expose schema as service by using BizTalk ECF service Publishing Wizard, you can also create receive location and you can bind the same receive location into the Orchestration.

    Friday, March 18, 2016 11:34 AM
  • but i am receiving System.xml.xmldocument message type so i am unable to map this data to another schema.

    On the receive Operation in the Orchestration, you have to use a Message that has the correct Type for the incoming message.  Then you will be able to use it in a Transform Shape.

    Meaning, the received Message must have a Schema type to be used in a Map.

    • Marked as answer by Angie Xu Friday, March 25, 2016 1:48 AM
    Friday, March 18, 2016 1:34 PM
    Moderator
  • Hi,

    For untyped message you can try the option provided by John-305.

    Alternative for this is you can use the ESB transform service to map dynamically for the untype messages.

    EDBTransformService.


    Regards, Aboorva Raja R Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Sunday, March 20, 2016 7:24 PM
  • Hi,

    In your orchestration try setting the messagetype(schema) to the receive shape and you can get the typed message.

    Cheers


    JB

    Sunday, March 20, 2016 8:53 PM