none
C# application and BizTalk Wcf-NetTCP comunication RRS feed

  • Question

  • Can someone guide through below scenario:

    I want to implement real-time Request-response scenario in which I send message from C# console app and it goes to BizTalk Receive Location and Orchestartion applies some business logic and send response back to console app.

    For simplicity sake, I achieved it follows, App gets user input, writes messages as xml to drive, Receive picks file by FILE adapter and generates response as another xml and app reads from that xml and displays to user. I believe this is ugly approach, want to interact directly with Receive and send.

    Thanks

    Thursday, January 8, 2015 4:28 AM

Answers

  • Thanks All,

    Just figured out NetNamedBinding configurations were disabled in SQL Server Configurations which is required for two way communications. It is part of BizTalk Installation, someone must have skipped it during installation process. To enable these follow below steps:

    To enable TCP/IP and Named Pipes
    1.    Click Start, click All Programs, click Microsoft SQL Server 2008 R2, click Configuration Tools, and then click SQL Server Configuration Manager.
    2.    In the left-hand pane, expand SQL Server Network Configuration.
    3.    Click Protocols for MSSQLSERVER.
    4.    Verify that both TCP/IP and Named Pipes are enabled. If they are, proceed to Step 5.

    If either is not, follow these steps:

    • Right-click the protocol, and then click Enable.
    • Repeat to enable the other protocol if necessary.
    • In the left-hand pane, click SQL Services.
    • In the right-hand pane, right-click SQL Server (MSSQLSERVER), and click Stop.
    • When the service has stopped, right-click SQL Server (MSSQLSERVER) again, and click Start.

       When the service has restarted, close the Configuration Manager.

    Vote up for Rachit, for providing Amazing link


    • Edited by Prabhdeep Gill Monday, January 12, 2015 9:50 PM
    • Marked as answer by Angie Xu Thursday, January 15, 2015 1:35 AM
    Monday, January 12, 2015 9:49 PM

All replies

  • For real time request response you  need two way communication . So you can expose your process schema or Orchestration as wcf service and consume it in your console application .

    You can also WCF-NetTcp Adapter as well which can work with Synchronous call scenarios .

    Below is the configuration steps listed over MSDN

    Configuring the WCF-NetTcp Adapter

    What Is the WCF-NetTcp Adapter

    Thanks

    Abhishek

    Thursday, January 8, 2015 5:48 AM
  • BizTalk configuration is easy and well documented, I have already done that. So my receive is ready and configured to look for any messages coming on specific netwrok adress and port number. I need some guidance on how to send messages from my application (client?).

    Does BizTalk provides out-of-box way to generate such client? and then I can call the client from Windows App.

    Thanks

    Thursday, January 8, 2015 8:45 PM
  • Hi Prabhdeep,

    Refer the link below.

    Send Message to BizTalk Receive Location with few lines of C# code through WCF-NetNamedPipe as Transport Type

    Here the developer has created a console application and then sends the message to BizTalk using WCF-NetNamedPipe Adapter.

    Rachit 

    Friday, January 9, 2015 3:34 AM
    Moderator
  • Hi Rachit,

    Thanks. That is best and closest to my requirement so far. And I implemented this configuration. Only problem is this is one-way (only send from console app). I am not able to figure out a way to configure it 2-way. Since, this is Request-Response adapter I am sure there would be a way to achive that.

    This wraps message like a SOAP message and my Orch rreceives it, but no body is subscribing to the response, since I don't have any code written in my app to receive responses (which I need help with - don't really have much knowledge around this adapter)

    Thanks

    Friday, January 9, 2015 4:08 AM
  • Yes you can use WCF-NetNamedPipe binding to send back the message to your console application.

    while configuring the request-response port make sure you have transfer mode set as "Streamed".

    To learn how to configure your console application to communicate both ways with BizTalk refer the link below.

    Streaming messages from ASP.NET to BizTalk

    So, my above mentioned post while help you to receive message in BizTalk and this one to setup the response back by configuring request-response port.

    HTH,

    Rachit 


    Friday, January 9, 2015 5:02 AM
    Moderator
  • Hi Pradeep ,

    The best option is to use correlation here between your send and receive as you can only post request in your scnerio  . You can pass the coreation token with request request and baes on corealtion token there will be send port which will send you the response message .

    Thanks
    Abhishek

    Friday, January 9, 2015 9:32 AM
  • Thanks Rachit,

    This post is very helpfull. I am almost there, Now my message is getting delivered but it doesnot return a response and timeout after one minute. Will keep trying

    Also, found following useful for Protocol exception (overcame this problem after reading this post)

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/1732b45d-d7b3-421e-a590-f7936db00d2f/the-net-framing-mode-being-used-is-not-supported-?forum=wcf

    Saturday, January 10, 2015 1:30 AM
  • Thanks All,

    Just figured out NetNamedBinding configurations were disabled in SQL Server Configurations which is required for two way communications. It is part of BizTalk Installation, someone must have skipped it during installation process. To enable these follow below steps:

    To enable TCP/IP and Named Pipes
    1.    Click Start, click All Programs, click Microsoft SQL Server 2008 R2, click Configuration Tools, and then click SQL Server Configuration Manager.
    2.    In the left-hand pane, expand SQL Server Network Configuration.
    3.    Click Protocols for MSSQLSERVER.
    4.    Verify that both TCP/IP and Named Pipes are enabled. If they are, proceed to Step 5.

    If either is not, follow these steps:

    • Right-click the protocol, and then click Enable.
    • Repeat to enable the other protocol if necessary.
    • In the left-hand pane, click SQL Services.
    • In the right-hand pane, right-click SQL Server (MSSQLSERVER), and click Stop.
    • When the service has stopped, right-click SQL Server (MSSQLSERVER) again, and click Start.

       When the service has restarted, close the Configuration Manager.

    Vote up for Rachit, for providing Amazing link


    • Edited by Prabhdeep Gill Monday, January 12, 2015 9:50 PM
    • Marked as answer by Angie Xu Thursday, January 15, 2015 1:35 AM
    Monday, January 12, 2015 9:49 PM