0

I have some requirement where i need to configure WCF service over TCP/IP protocol. I am able to do that by adding end point. Client which is going to consume service will use some tool to push information. That tool take only IP address and Port Number.

Now i need some way to invoke service method by default on hitting IP with TCP/IP port. Is there any way to implement this? Or any workaround for this?

What i need is that there is some method in service i.e. UploadFile. Service is using netTCPbinding. I have hosted it on server. so the URL is something "net.tcp://XXX.XXX.XX.XXX:8080/XXXXServices.svc/mextcp". Customer is using this for consuming. BUT the problem is my customer using some tool which accpt only IPAdress and Port No over TCP. I am trying to configure service in such a way that when he sent, data by default UploadFile service get called. I hope it's make sense.

Thanks!

Amit Soni
  • 3,216
  • 6
  • 31
  • 50
  • TCP and IP aren't application protocols. You don't "hit" a port, you connect to one and send a message, the message explaining to your service what action it should invoke. The format of the message is dictated by the protocol you use (`net.TCP` perhaps?), the framing of the message is also dictated by the application protocol. All in all it's unclear what you're asking. – CodeCaster May 04 '15 at 13:42
  • @CodeCaster Thanks for revert. What i need is that there is some method in service i.e. UploadFile. Service is using netTCPbinding. I have hosted it on server. so the URL is something "net.tcp://XXX.XXX.XX.XXX:8080/XXXXServices.svc/mextcp". Customer is using this for consuming. BUT the problem is my customer using some tool which accpt only IPAdress and Port No over TCP. I am trying to configure service in such a way that when he sent, data by default UploadFile service get called. I hope it's make sense. – Amit Soni May 04 '15 at 14:02
  • You're not very likely to find a configuration that will allow you to do this. Depending on what kind of tool your client is using, it speaks a protocol. For example TFTP. Then you will have to host a "TFTP to Net.TCP translation service" that listens on the port for requests and translates incoming requests to a message WCF understands. But like I said, it all depends on what protocol this tool from your client speaks. – CodeCaster May 04 '15 at 14:06
  • When say IP do you mean over HTTP? if so why not use a simple HTTP binding? – Coder1409 May 04 '15 at 14:08
  • @CodeCaster client is using "UltraPort TCP/IP HL7 Router" tool for sending hl7 messages.. I have created a wcf service with TCP binding. This is tool is not worked as consuming service. Its just send message over tcp port. – Amit Soni May 05 '15 at 05:03
  • 1
    Yeah, so you'll have to [write something that listens for and interprets the HL7 messages](http://stackoverflow.com/questions/1999159/dotnet-hl7-integration-library) and forwards them as a WCF call. – CodeCaster May 05 '15 at 11:14
  • Absolutely @CodeCaster.. Is there no direct way to call service? – Amit Soni May 05 '15 at 11:24
  • 1
    No, there isn't. WCF expects a framing protocol and an application protocol, which just a raw TCP stream (or however HL7 is implemented) isn't. You'll have to write your own WCF binding that accepts HL7 messages, and you don't want that. – CodeCaster May 05 '15 at 11:26

0 Answers0