locked
BizTalk 2K13 consuming RESTful Service RRS feed

  • Question

  • Hi Guys

    I've a requirement under which my BizTalk Orchestration has to consume a RESTful service ( this too is being developed by me).

    The contract of the service is such that it expects a collection of records as input and it returns a collection of records as output.

    Can anyone please help me with inputs on how best I can have the integration going ,so that I still have the strongly-typed request/ responses on the BizTalk side without having to deal with custom processing of the un-typed message going in and out of BizTalk while consuming the RESTful service.

    Also what would be the preferred mode of content - XML or Json

    Thanks

    Amit

    Thursday, May 8, 2014 5:19 PM

Answers

  • Can anyone please help me with inputs on how best I can have the integration going ,so that I still have the strongly-typed request/ responses on the BizTalk side without having to deal with custom processing of the un-typed message going in and out of BizTalk while consuming the RESTful service.

    Really, all you have to do is send and receive your Xml messages, there's no special process or anything.  BizTalk does not enforce Schema/Message Types or Contracts on the edge so any of the WCF Adapters will happily send or receive any content.

    Validation would only happen in the Receive Pipeline or Orchestration if you configured it just like any other process.  Consequently, there would be no custom processing of un-typed messages, you would just process the message like any other message.

    Meaning, an "untyped" message, internally called an "unparsed interchange", will always hit the Receive Pipeline.  It's a Pipeline Component, usually the XmlDisassembler, that resolves the Message Type.

    Single record or collection of records doesn't really matter so long as the Schema(s) match.

    BizTalk Server 2013 R2 will bring native JSON support.

    Wednesday, June 11, 2014 11:41 AM
    Moderator

All replies

  • A collection of messages are best dealt with by using an Envelope Schema.  This allows you to wrap multiple messages in a single message.  For XML, your message would look something like this:

    <myEnvelope>
      <singleMessage>Blah</singleMessage>
      <singleMessage>Blah</singleMessage>
      <singleMessage>Blah</singleMessage>
    </myEnvelope>

    The XML Disassemble Pipeline component would then be able to de-batch your messages into individual instances for processing in BizTalk.


    If this is helpful or answers your question - please mark accordingly.
    Because I get points for it which gives my life purpose (also, it helps other people find answers quickly)

    Wednesday, June 11, 2014 10:15 AM
  • Can anyone please help me with inputs on how best I can have the integration going ,so that I still have the strongly-typed request/ responses on the BizTalk side without having to deal with custom processing of the un-typed message going in and out of BizTalk while consuming the RESTful service.

    Really, all you have to do is send and receive your Xml messages, there's no special process or anything.  BizTalk does not enforce Schema/Message Types or Contracts on the edge so any of the WCF Adapters will happily send or receive any content.

    Validation would only happen in the Receive Pipeline or Orchestration if you configured it just like any other process.  Consequently, there would be no custom processing of un-typed messages, you would just process the message like any other message.

    Meaning, an "untyped" message, internally called an "unparsed interchange", will always hit the Receive Pipeline.  It's a Pipeline Component, usually the XmlDisassembler, that resolves the Message Type.

    Single record or collection of records doesn't really matter so long as the Schema(s) match.

    BizTalk Server 2013 R2 will bring native JSON support.

    Wednesday, June 11, 2014 11:41 AM
    Moderator
  • Yes, I went ahead with the XML format since the message size is still relatively small and hence should not affect the performance irrespective of the format I go with XML / JSON.

    On the schema front all I did was to manually create the request / response schema to match the Service contract and used the WCF-WebHttp Adapter on the Send side with appropriate configuration.

    Thanks for the responses.

    Wednesday, June 25, 2014 4:36 PM