BizTAlk WCF-Net.Tcp Adapter Consumption issue

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › BizTAlk WCF-Net.Tcp Adapter Consumption issue

Viewing 1 reply thread
  • Author
    Posts
    • #20138

      Hey !

      I am using BizTalk R2  Net.Tcp Adapter of WCF. I can call BizTalk Service successfully but when receive at the client side, it shows the response as null.Although there is no exception throws at the client side and neither it is suspended at the BizTalk side.

       

      For response verification i checked by suspend the message like I call the service and immediately closed the client than it show me right message in the  BizTalk console.

        

      For reference, code is given below.

       

      Thanks for your time and Consideration.

        

       

      //Client Side Code

       

      [ServiceContract]

      public interface ImyInterface

      {

        [OperationContract(ReplyAction = “*”)]

         MemoryStream SendRequest(Stream stream);

      }

       

       

      string addressURI = “net.tcp://localhost:8889/myservice”;

      NetTcpBinding binding = new NetTcpBinding(SecurityMode.None);

      EndpointAddress endpointAddress = new EndpointAddress(addressURI);

       

      using (ChannelFactory<ImyInterface> factory = new ChannelFactory<ImyInterface>(binding, endpointAddress))               

      {

        ImyInterface channel = factory.CreateChannel();

        // Get data bytes

        byte[] data = GetEncodedData(myXmlMessage);

       

         byte[] buffer = new byte[data.Length];

                         

         data.CopyTo(buffer, 0);

         MemoryStream stream_ = new MemoryStream(buffer);

         MemoryStream resp = channel.SendRequest(stream_);

       

         //resp null; stream_ shows the request msg

      }

       

      At the BizTalk end using  path and template option and security mode is set to none.

       

       

      Regards,

      Atif Suleman

       

       

       

    • #20140

      Here are some techniques you can use to debug:

      • In the BizTalk admin console, stop the orchestration.  Then run the client to send a message into BizTalk.  Now, run a query for “All Instances” in the BizTalk admin console, and you should see a suspended instance of the orchetration.  This will allow you to verify that the input message is correct.
      • Create a FILE send port.  Add a filter to the send port that will make it consume the response message from your orchestration.  Now, when you call the orchestration, it should write out a copy of the response message to a file.
      • Add Trace.WriteLine statements to your orchestration.  View them in Sysinternals DebugView.
      • Turn on WCF tracing.  Use SvcConfig to enable tracing:  http://msdn.microsoft.com/en-us/library/ms733025.aspx

      Hope this helps!

      • #20150

        Thanks Russell

        The techniques you told me it is really useful I applied all.

        Response message is coming fine in the File. But again showing null at the client with no exception.

         

        After enable the WCF Tracing I found exception in the tracing data i.e.

         

        The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was ‘10675199.02:48:05.4775807’

         

        System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

         

         

         

        Even I tried after increasing the timeouts at the client and server side but same exception in the tracing.

         

        //timeouts

        TimeSpan ts = new TimeSpan(0, 5, 0);

        binding.CloseTimeout = ts;

        binding.OpenTimeout = ts;

        binding.PortSharingEnabled = true;

        binding.ReceiveTimeout = ts;

        binding.SendTimeout = ts;

         

        //my uri is

        net.tcp://localhost:8899/myservice

         

         

        But I am not getting why client and biztalk both remain calm doesn’t throw any exception or suspended the message.

         

        Kindly can u tell me what steps I have to take to resolve this exception.

         

        Thanks

        Atif Suleman

         

         

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.