Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
When we create a WCF- NetTcp receive ___location in BizTalk server, the receive ___location acts itself as a wcf service and is hosted in BTSNTSvc (BizTalk process).
Now the service can be invoked by different type of client to submit message to the BizTalk layer.
Now, net.tcp://localhost/SampleTestService/receiveInvoice.svc can be used as WCF service.
Suppose I want to have another receive ___location to receive PO, so I create another receive ___location
Now, net.tcp://localhost/SampleTestService/receivePO.svc is another WCF service.
But, when I enable the receive ___location I get the error
The Messaging Engine failed to add a receive ___location "TstRcvLocPO" with URL "net.tcp://localhost/SampleTestService/receivePO.svc" to the adapter "WCF-NetTcp".
Reason: "System.ServiceModel.AddressAlreadyInUseException: There is already a listener on IP endpoint 0.0.0.0:808
Since, there is more than one service using the same port 808 we will have to enable port sharing, if you want to use 808 for both the service.
Enable port Sharing service in the services.msc
After enabling the port Sharing service you will be able to resolve the above error.
But when you are using the WCF-custom adapter you will additionally have to enable port sharing property in the binding tab of the receive ___location.
Suppose, you have one receive ___location with WCF-NetTcp adapter and another one with WCF-custom adapter with NetTcp binding both are using the same port 808,
now even though I have enabled port sharing option both in receive ___location and the service. I will still the same error
The Messaging Engine failed to add a receive ___location "TstRcvLocPO" with URL "net.tcp://localhost/SampleTestService/receivePO.svc" to the adapter "WCF-NetTcp".
Reason: "System.ServiceModel.AddressAlreadyInUseException: There is already a listener on IP endpoint 0.0.0.0:808
This is because the WCF-NetTcp adapter and the WCF-custom adapter with NetTcp binding recognize each other as a different binding and will not be able to share the same port between each other.
In order to overcome such a problem you will have to create different port for either the WCF-custom or the WCF-NetTcp adapter.
I changed the adapter to something like this
Now the WCF-custom receive ___location is using the port 810 and I was able to use the receive ___location.
Note:- please make sure you share the new URI with the clients that are using the receive ___location, that is along with the port number.
net.tcp://localhost:810/SampleTestService/ReceivePOcustom.scv
Hope this is useful for the BizTalk developer like me. Happy BizTalking!!
Written by
Shashidharan Krishnan
Reviewed by
Shailesh Agre
Microsoft GTSC
Comments
- Anonymous
July 16, 2013
Hi ,I like your article on WCF port sharing issues.Thanks,Sachin - Anonymous
October 30, 2014
Great write-up. Thanks!