none
ESB Toolkit support for REST & JSON RRS feed

  • Question

  • Hi All,

    Does the ESB Toolkit & BRE support POST or GET to a REST service? using JSON

    there is appears to be no Outbound transport support for WCF-WebHTTP nor anyway to set a custom pipeline component. 

    Cheers D

    Friday, December 16, 2016 2:59 PM

Answers

  • The answer depends on how you define "support". The ESBT itself does not include adapter provider for WCF-WebHttp, but it does work well with any BizTalk send adapter if there is a provider for it. I've created WCF-WebHttp adapter provider and the manifest below:

    namespace Samples.AdapterProviders.WcfWebHttp

    {

        public sealed class AdapterProvider: WCFBaseAdapterProvider

        {

            public override string AdapterName

            {

                get{ return "WCF-WebHttp”;}

            }

        }

    }

    The config:

    <adapterProvider moniker="Http,Https" name="WCF-WebHttp" type="Samples.AdapterProviders.WcfWebHttp.AdapterProvider, Samples.AdapterProviders.WcfWebHttp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=<Your PKT>” />

    For the manifest, simply create WCF-WebHttpPropertyManifest.xml, perhaps as copy of WCF-CustomPropertyManifest.xml and then add the following properties to it:

    <property name="SuppressMessageBodyForHttpVerbs" type="WCF.SuppressMessageBodyForHttpVerbs" assembly="globalPropertySchemas" />

    <property name="HttpMethodAndUrl" type="WCF.HttpMethodAndUrl" assembly="globalPropertySchemas" />

    <property name="VariablePropertyMapping" type="WCF.VariablePropertyMapping" assembly="globalPropertySchemas" />

    <property name="HttpHeaders" type="WCF.HttpHeaders" assembly="globalPropertySchemas" />

    <property name="SecurityMode" type="WCF.SecurityMode" assembly="globalPropertySchemas" />

    </properties>

    Once this is done, you can use resolver the designer, for example if you use PUT method with variable mapping and Json:

    Action: 

    {Ignored}

    Address:

    http://localhost:5000/api/sample

    HttpHeaders:

    content-type:application/json

    HttpMethodAndUrl:

    <BtsHttpUrlMapping><Operation Url='/{APC}' Method ='PUT'/></BtsHttpUrlMapping>

    ValuePropertyMapping:

    <BtsVariablePropertyMapping xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>

       <Variable Name='APC' PropertyName='RetryInterval' PropertyNamespace='http://schemas.microsoft.com/BizTalk/2003/system-properties' />

    </BtsVariablePropertyMapping>


    Monday, December 19, 2016 7:51 PM
  • Well, given the BizTalk is an ESB, with or without the ESBT, the only decision is whether or not the ESBT tools help with certain specific scenarios.

    So, it's not just a matter of ESBT supports REST, it's whether or not the app itself, regardless of the message formats or protocols, is helped by the ESBT tools.

    What I'm saying is the BizTalk is already your ESB.  It's a common misconception that ESBT is what makes BizTalk an ESB platform, that is absolutely not the case.  ESBT is just design patterns that you can use in Visual Studio.

    Given that, my advice is always start without using ESBT and when you can demonstrate it adds net value, use it.

    As for you specific situation, probably all you need to do is create a custom provider for the WCF-WebHttp Adapter so it can appear to the resolvers.

    This Wiki Article explains the process: http://social.technet.microsoft.com/wiki/contents/articles/22035.biztalk-server-2013-creating-custom-adapter-provider-in-esb-toolkit-sftp-as-an-example.aspx

    Friday, December 16, 2016 4:42 PM
  • Hi,

    Nino Crudele combined a ESB toolkit pattern with ReST in BizTalk 2013

    Refer : http://ninocrudele.me/2012/11/28/r-esb-another-way-to-use-rest-in-biztalk-2013/




    Rachit Sikroria (Microsoft Azure MVP)

    Friday, December 16, 2016 4:42 PM
    Moderator

All replies

  • Can you explain a bit more about your situation?

    Do you really need to use the ESBT?  I ask because everything you can do with the ESBT, you can do with BizTalk out of the box and usually easier.

    Friday, December 16, 2016 3:26 PM
  • I have been able to achieve my end goal using BizTalk without ESB but I want to know if ESB provides support for REST. I am prototyping a ESB and if ESB Toolkit doesnot support rest it is an easy decision for us

    Friday, December 16, 2016 3:36 PM
  • Well, given the BizTalk is an ESB, with or without the ESBT, the only decision is whether or not the ESBT tools help with certain specific scenarios.

    So, it's not just a matter of ESBT supports REST, it's whether or not the app itself, regardless of the message formats or protocols, is helped by the ESBT tools.

    What I'm saying is the BizTalk is already your ESB.  It's a common misconception that ESBT is what makes BizTalk an ESB platform, that is absolutely not the case.  ESBT is just design patterns that you can use in Visual Studio.

    Given that, my advice is always start without using ESBT and when you can demonstrate it adds net value, use it.

    As for you specific situation, probably all you need to do is create a custom provider for the WCF-WebHttp Adapter so it can appear to the resolvers.

    This Wiki Article explains the process: http://social.technet.microsoft.com/wiki/contents/articles/22035.biztalk-server-2013-creating-custom-adapter-provider-in-esb-toolkit-sftp-as-an-example.aspx

    Friday, December 16, 2016 4:42 PM
  • Hi,

    Nino Crudele combined a ESB toolkit pattern with ReST in BizTalk 2013

    Refer : http://ninocrudele.me/2012/11/28/r-esb-another-way-to-use-rest-in-biztalk-2013/




    Rachit Sikroria (Microsoft Azure MVP)

    Friday, December 16, 2016 4:42 PM
    Moderator
  • The answer depends on how you define "support". The ESBT itself does not include adapter provider for WCF-WebHttp, but it does work well with any BizTalk send adapter if there is a provider for it. I've created WCF-WebHttp adapter provider and the manifest below:

    namespace Samples.AdapterProviders.WcfWebHttp

    {

        public sealed class AdapterProvider: WCFBaseAdapterProvider

        {

            public override string AdapterName

            {

                get{ return "WCF-WebHttp”;}

            }

        }

    }

    The config:

    <adapterProvider moniker="Http,Https" name="WCF-WebHttp" type="Samples.AdapterProviders.WcfWebHttp.AdapterProvider, Samples.AdapterProviders.WcfWebHttp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=<Your PKT>” />

    For the manifest, simply create WCF-WebHttpPropertyManifest.xml, perhaps as copy of WCF-CustomPropertyManifest.xml and then add the following properties to it:

    <property name="SuppressMessageBodyForHttpVerbs" type="WCF.SuppressMessageBodyForHttpVerbs" assembly="globalPropertySchemas" />

    <property name="HttpMethodAndUrl" type="WCF.HttpMethodAndUrl" assembly="globalPropertySchemas" />

    <property name="VariablePropertyMapping" type="WCF.VariablePropertyMapping" assembly="globalPropertySchemas" />

    <property name="HttpHeaders" type="WCF.HttpHeaders" assembly="globalPropertySchemas" />

    <property name="SecurityMode" type="WCF.SecurityMode" assembly="globalPropertySchemas" />

    </properties>

    Once this is done, you can use resolver the designer, for example if you use PUT method with variable mapping and Json:

    Action: 

    {Ignored}

    Address:

    http://localhost:5000/api/sample

    HttpHeaders:

    content-type:application/json

    HttpMethodAndUrl:

    <BtsHttpUrlMapping><Operation Url='/{APC}' Method ='PUT'/></BtsHttpUrlMapping>

    ValuePropertyMapping:

    <BtsVariablePropertyMapping xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>

       <Variable Name='APC' PropertyName='RetryInterval' PropertyNamespace='http://schemas.microsoft.com/BizTalk/2003/system-properties' />

    </BtsVariablePropertyMapping>


    Monday, December 19, 2016 7:51 PM
  • I came back to revisit this solution and folowed your advice and i have a REST adapter up and running. Thanks for the help.
    Thursday, September 7, 2017 11:26 AM