locked
Biztalk Server 2010 basic queries RRS feed

  • Question

  • Hi all,

    I have started using biztalk server 2010 in Visual Studio 2010  a few days back and i am facing so many confusions while doing this.

    1)From front end how will we call biztalk function?.In .net we will call "https://12.2.1./Controllername/function name

    2)Also the base url(for eg:12.2.1.)will be different for each api?

    3)Currently i am doing this in my local system and manually configuring ports.But when i put this into server whether i need to configure it again?

    4)I need my output in json format.Is there function available to get my output in json format?

    Can anyone please help me to sort out this?

    Monday, June 20, 2016 5:29 AM

Answers

  • Hi Suja

    1)

    https://12.2.1./Controllername/function - what is this service? Is this a BizTalk service or a .NET Web API/WCF service? Calling a service is the same from frontend, the difference lies in creating a BizTalk service.

    If you don't have a BizTalk service, you have to create one first. Refer the below links on how to expose a RESTful API from BizTalk 2010-

    http://blogical.se/blogs/mikael/archive/2012/05/28/rest-start-kit-for-biztalk-server.aspx

    http://blogical.se/blogs/mikael/archive/2012/03/07/exposing-json-rest-endpoints-from-biztalk.aspx

    2) No the base URL corresponds to the server. If the same server hosts the services, it will be the same.

    3) You have to first deploy and test the application in your local system. If it works, you can export that application using MSI + binding files and apply the same to different servers. Refer below links-

    https://msdn.microsoft.com/en-us/library/aa559168.aspx

    https://msdn.microsoft.com/en-us/library/aa559631.aspx

    4) BizTalk 2010 doesn't have native JSON support. But, you can use custom pipeline components to convert XML format to JSON while sending back response. Refer sample code here-

    https://wcfbiztalk.wordpress.com/2013/08/31/json-send-and-receive-pipelines-for-biztalk-server-2/

    Note:

    Dealing with JSON + REST APIs is much easier from BizTalk 2013, so if you can use it instead, it is recommended.


    Thanks Arindam





    Monday, June 20, 2016 5:38 AM
    Moderator
  • Hi Suja

    Have you created a BizTalk orchestration? If yes, once you build the project in Visual Studio, you will get an assembly for it. You have to specify that assembly while running the wizard. So, when it asks for assembly, you have to browse to your orchestration project folder, go to bin\Debug, and select the orchestration assembly(.dll file).

    Microsoft.Biztalk.Baseadapter.dll is not an orchestration assembly. It is an assembly that is shipped with the BizTalk setup - it's meant for different purpose altogether.

    Refer this-

    http://biztalkvillage.blogspot.in/2013/03/exposing-orchestration-as-wcf-service.html

     After clicking next we have two options Service Endpoint & Metadata only endpoint.
    We'll choose Service endpoint & also create a receive location in the deployed BizTalk
    project.
    After that clicking next we see two options of exposing either schema or 
    Orchestration.Choose Orchestration & click next.
    Then we need to choose our Biztalk project dll. This is the orchestration assembly/dll that you have created and built using Visual Studio.




    Same is also mentioned in MSDN here-

    On the BizTalk Assembly page, verify that the binary (.dll) Visual Studio project is selected for the BizTalk assembly file, and then clickNext.

    noteNote

    If you launch this wizard from theStart menu, you have to select the .dll file manually by browsing to the output directory of the Visual Studio solution. 

    https://msdn.microsoft.com/en-us/library/bb745989.aspx



    Monday, June 27, 2016 5:57 AM
    Moderator
  • Hi Suja

    So, there is no code to write, download the Starter Kit from here.

    And then follow the steps shared earlier and also in the blog post you are following. Specifically you need the BizTalkRESTRequestHandler behavior extension to be able to accept dynamic URIs. Refer back to my earlier post on how to register it with WCF-CustomIsolated Receive Handler from Admin Console. Once you register it, in the actual ReceiveLocation, you can add the above behavior and set the UriTemplate property to be able to accept dynamic URIs. I would suggest you follow the 'How to Use it' steps exactly as mentioned here.

    Also read the 'How it works' section(esp. the "Exposing REST services (Receive Locations)" section) quite a few times to understand the overall flow. Basically, if you are accepting query parameters in your URL, the parameter values will be put in an XML message and passed on to BizTalk. Once you get the XML message with the URI parameter values, you can use them as you like, eg: map those values to a Stored Proc request schema, etc.

    Let us know if you face any issues while following along.

    SNAGHTML16fae3c2


    Thanks Arindam




    Monday, June 27, 2016 12:43 PM
    Moderator
  • Hi

    If you are communicating with Oracle, while creating the schemas from the wizard, it will have created a binding file(bindinginfo.xml file) for you. You can import that binding file in your application in Admin Console, it will create the static SendPort for you. You just have to provide the password in that static SendPort. No need for any behaviors in the Oracle SendPort.

    Once the SendPort is created, you can bind it to your orchestration's logical SendPort in Admin Console(launch your orchestration in Admin Console -> Bindings). Make sure that both the WCF ReceivePort and the Oracle SendPort are bound to the logical ports. Then you should be able to start the App.

    One request - this thread is getting rather long, and deviating from the original question. Can I ask you to mark answers as appropriate here, and create a new thread for your new queries.


    Thanks Arindam




    Tuesday, June 28, 2016 9:55 AM
    Moderator

All replies

  • Hi Suja

    1)

    https://12.2.1./Controllername/function - what is this service? Is this a BizTalk service or a .NET Web API/WCF service? Calling a service is the same from frontend, the difference lies in creating a BizTalk service.

    If you don't have a BizTalk service, you have to create one first. Refer the below links on how to expose a RESTful API from BizTalk 2010-

    http://blogical.se/blogs/mikael/archive/2012/05/28/rest-start-kit-for-biztalk-server.aspx

    http://blogical.se/blogs/mikael/archive/2012/03/07/exposing-json-rest-endpoints-from-biztalk.aspx

    2) No the base URL corresponds to the server. If the same server hosts the services, it will be the same.

    3) You have to first deploy and test the application in your local system. If it works, you can export that application using MSI + binding files and apply the same to different servers. Refer below links-

    https://msdn.microsoft.com/en-us/library/aa559168.aspx

    https://msdn.microsoft.com/en-us/library/aa559631.aspx

    4) BizTalk 2010 doesn't have native JSON support. But, you can use custom pipeline components to convert XML format to JSON while sending back response. Refer sample code here-

    https://wcfbiztalk.wordpress.com/2013/08/31/json-send-and-receive-pipelines-for-biztalk-server-2/

    Note:

    Dealing with JSON + REST APIs is much easier from BizTalk 2013, so if you can use it instead, it is recommended.


    Thanks Arindam





    Monday, June 20, 2016 5:38 AM
    Moderator
  • Hi Suja

    Have you created a BizTalk orchestration? If yes, once you build the project in Visual Studio, you will get an assembly for it. You have to specify that assembly while running the wizard. So, when it asks for assembly, you have to browse to your orchestration project folder, go to bin\Debug, and select the orchestration assembly(.dll file).

    Microsoft.Biztalk.Baseadapter.dll is not an orchestration assembly. It is an assembly that is shipped with the BizTalk setup - it's meant for different purpose altogether.

    Refer this-

    http://biztalkvillage.blogspot.in/2013/03/exposing-orchestration-as-wcf-service.html

     After clicking next we have two options Service Endpoint & Metadata only endpoint.
    We'll choose Service endpoint & also create a receive location in the deployed BizTalk
    project.
    After that clicking next we see two options of exposing either schema or 
    Orchestration.Choose Orchestration & click next.
    Then we need to choose our Biztalk project dll. This is the orchestration assembly/dll that you have created and built using Visual Studio.




    Same is also mentioned in MSDN here-

    On the BizTalk Assembly page, verify that the binary (.dll) Visual Studio project is selected for the BizTalk assembly file, and then clickNext.

    noteNote

    If you launch this wizard from theStart menu, you have to select the .dll file manually by browsing to the output directory of the Visual Studio solution. 

    https://msdn.microsoft.com/en-us/library/bb745989.aspx



    Monday, June 27, 2016 5:57 AM
    Moderator
  • Hi Suja

    There is no WCF-WebHttp adapter in BizTalk 2010, hence no option to declare the URL mapping explicitly. Your option in that case is to use the WCF-CustomIsolated adapter with webHttpBinding. Note that REST does not have any wsdl/SOAP contract, so you can create such a ReceiveLocation manually in BizTalk Admin Console. If you already created the ReceiveLocation using the wizard, you can change the adapter type to WCF-CustomIsolated adapter. Configure the adapter and in binding Tab, set bindingType as webHttpBinding as below-

     

    Are you exposing a REST service? 

    If yes, are you exposing a static service URL, or a dynamic/truly RESTful URL?

    Dynamic URLs (the client can potentially call a different URL each time while calling your service)-

    http://localhost:8080/MyService/Bookings/2012/11
    http://localhost:8080/MyService/Bookings/2012/12
    http://localhost:8080/MyService/Employees?firstname=Caren&lastname=Smith
    http://localhost:8080/MyService/Employees?firstname=Caren&lastname=Johnson

    Static URL example- (single service URL exposed to calling client)

    http://localhost:8080/MyService/Bookings/

    Next thing to consider is what content will you accept - XML or JSON? 

    Based on the answers to the above questions, we can provide more specific answers.

    If on BizTalk 2010, easiest way to expose dynamic URLs is using the REST Starter kit as discussed on the link you shared.

    If the URL is static, it is simpler to achieve, no need for the starter kit-

    If you want to receive JSON over this URL, refer the Scenario2 solution shared here. This will parse the JSON and submit the XML message to BizTalk. Your orchestration Receive Shape can receive the message of this schema type. If your URL is static like http://localhost:8080/MyService, no need to refer the below details.

    I would suggest you review the comments on the thread you shared once again and post here if you have any further queries.


    Thanks Arindam




    Monday, June 27, 2016 7:00 AM
    Moderator
  • Hi Suja

    Do you have clarity on the exact project requirements? I have posted a few questions earlier if you can get clarity on those, I guess we will be in a position to offer more precise answers. If your project requirements don't involve exposing a dynamic URL/a URL that accepts query parameters, you don't need the Starter Kit.

    To answer your specific question, follow this. In your case, apply for WCF-CustomIsolated instead of WCF-Custom as described below.

    2. Register the behavior

    To do this, select the WCF-Custom adapter under Platform Settings –> Adapters in the BizTalk Administration Console. Double-click the Receive Handler and click the Properties button. Then click the Import button and browse to the WCF-Custom.BindingsExtension-ReceiveHandler.config found in both the solution folder and the installation folder. Repeat the steps for the Send handler using the WCF-Custom.BindingsExtension-SendHandler.config file.

    SNAGHTML16ea3c8b

    http://blogical.se/blogs/mikael/archive/2012/05/28/rest-start-kit-for-biztalk-server.aspx


    Thanks Arindam



    Monday, June 27, 2016 11:52 AM
    Moderator
  • Hi 

    We are designing an application with frontend in angular js and backend in oracle with biztalk 2010 as middleware.

    STEPS DONE TILL NOW

    By connecting to the database i have accessed a package from oracle side and it automatically generated schema for the stored procedure

    Then created two request response ports and defined orchestration and configured the schema messages to the orchestration and deployed the solution

    Next step is to configure receive location in admin console:For that i followed the steps mentioned in the msdn link

    But failed to do url mapping directly.For that i need to use reststarter kit(Whether i need to write code for this to implement it or configuration only?)

    I have total 25 apis for different functionality in the application so i need to use dynamic url concept.

    Currently i got stuck how to implement using  reststarter kit in my application.

    Monday, June 27, 2016 12:15 PM
  • Hi Suja

    So, there is no code to write, download the Starter Kit from here.

    And then follow the steps shared earlier and also in the blog post you are following. Specifically you need the BizTalkRESTRequestHandler behavior extension to be able to accept dynamic URIs. Refer back to my earlier post on how to register it with WCF-CustomIsolated Receive Handler from Admin Console. Once you register it, in the actual ReceiveLocation, you can add the above behavior and set the UriTemplate property to be able to accept dynamic URIs. I would suggest you follow the 'How to Use it' steps exactly as mentioned here.

    Also read the 'How it works' section(esp. the "Exposing REST services (Receive Locations)" section) quite a few times to understand the overall flow. Basically, if you are accepting query parameters in your URL, the parameter values will be put in an XML message and passed on to BizTalk. Once you get the XML message with the URI parameter values, you can use them as you like, eg: map those values to a Stored Proc request schema, etc.

    Let us know if you face any issues while following along.

    SNAGHTML16fae3c2


    Thanks Arindam




    Monday, June 27, 2016 12:43 PM
    Moderator
  • You can safely change the wizard created WCF ReceiveLocation configuration with the adapter settings as mentioned in the link.

    Since your client is not SOAP based, it will not be generating a proxy from the WCF service. You can disable wsdl metadata generation in the web.config file of the wizard created WCF service to enforce this. So, in IIS browse to the BizTalk WCF service application/virtual directory, and in the web.config disable metadata as by changing this-

    <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />

    to

    <serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />


    Thanks Arindam



    Monday, June 27, 2016 3:35 PM
    Moderator
  • 1. Yes, so http://localhost/___ will be your base URL. You can confirm this by opening admin console, and go to the WCF Receive Location and check the URI property. It will probably be something like - ___/YourServiceName.svc

    So, your base URI maybe something like - http://localhost/___/YourServiceName.svc

    Browse to the .svc file from IIS to get this base URI.

    2)No, it has no relation to your schema/nodename. It is just part of the URI that indicates what this API is meant for. It can be anything. When the client would specify /Employees in the URI they hit, it will come to your ReceiveLocation. You can change it to something like /Students if that is what you want the client URI to be.

    3) Bit of clarification on this point-

    firstname=Caren&lastname=Smith is actual the query string paramter - it is appended to the URI. For a GET request the client should not send any payload/XML body. Looking at your XML message, it looks like you should receive that XML as part of the HTTP body content, and not in the query parameter values in the URI. If that is the case, you don't need the BizTalkRESTRequestHandler at all. The client should do a HTTP Post with the XML content they need to send. The actual service URI should be static. If you want to receive P_PERSON_ID and TIME_STAMP values in the service URI itself, only then you need the BizTalkRESTRequestHandler and the uriTemplates property.


    Thanks Arindam


    Tuesday, June 28, 2016 7:58 AM
    Moderator
  • You can pass it to Oracle in both cases, even if you receive the parameter values in URI( HTTP GET), or if you receive the XML message in the request body(HTTP POST). Please check with the calling client what type of service operation you need to expose- GET (meaning the values will be in the URI, no message content allowed), or POST(static URI with the request message coming via HTTP body/payload).

    Only if it is GET request, you need to use the above approach of BizTalkRESTRequestHandler.


    Thanks Arindam

    Tuesday, June 28, 2016 8:19 AM
    Moderator
  • So i need static urls.Then after deploying the project and publishing the wizard i dont need to set behavior.Also i dont need to configure adapter in platform settings.

    Yes, that is correct.

    So, make sure the adapter type is WCF-CustomIsolated. In bindings tab, make sure it is set to webHttpBinding. In the ReceiveLocation, set the pipeline to XMLReceive.

    Now, from the client that is calling send the XML message(with namespaces) - the message that you posted. This message will be received by your orchestration and further processing will happen.


    Thanks Arindam

    Tuesday, June 28, 2016 9:20 AM
    Moderator
  • Hi

    If you are communicating with Oracle, while creating the schemas from the wizard, it will have created a binding file(bindinginfo.xml file) for you. You can import that binding file in your application in Admin Console, it will create the static SendPort for you. You just have to provide the password in that static SendPort. No need for any behaviors in the Oracle SendPort.

    Once the SendPort is created, you can bind it to your orchestration's logical SendPort in Admin Console(launch your orchestration in Admin Console -> Bindings). Make sure that both the WCF ReceivePort and the Oracle SendPort are bound to the logical ports. Then you should be able to start the App.

    One request - this thread is getting rather long, and deviating from the original question. Can I ask you to mark answers as appropriate here, and create a new thread for your new queries.


    Thanks Arindam




    Tuesday, June 28, 2016 9:55 AM
    Moderator