locked
Accessing a WCF Service located in other system from another system in same network. RRS feed

  • Question

  • User269148008 posted

    Hi All,

    I have tried my best to find a solution for this,

    I have a WCF Service which transfer a file from one system to other system, which are in same Network, this is called as FileTransfer Service(FTS). FTS accepts the byte stream and the file name.

    Example: I have 5 Systems in my Network, I need to have the FTS in one of the System, all other 4 Systems should access one system and give the ByteStream + File Name as Input to the FTS, the FTS will save the file in the local system(i.e., in the same System where FTS is running). It is working pretty well, when I deploy the service in IIS of the System(Where FTS is there) and give URI as service reference in other 4 systems. 

    But, the question is I dont want to use IIS, I can not use Self-Hosting Either(Coz, Self-Hosting will enable to access the Service in the same System, please correct me If I am WRONG). Give me a solution for this.

    My Thoughts: Can we access a system's Service from another System in same network, with the help of System IP/System Name(Where my FTS is running)

    Help needed, Urgency!!

    TY.

    Thursday, July 4, 2013 9:28 AM

Answers

  • User-488622176 posted

    you can host on any available port on the system. The URI could be somehting like: net.tcp://localhost:12345/MyService.svc. You determine this port yourself. it must be free.

    For TCP + SSL => you'll need to register the certificate for that port. It is a little much more complex then when you host on IIS using https as protocol.

    For accessing the service from other machines, use the net.tcp://servername:12345:MyService.svc URI, where <servername> is the machinename or domainname of the server hosting the windows service.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 8, 2013 7:32 AM

All replies

  • User-2005691517 posted

    shivatejam

    I can not use Self-Hosting Either(Coz, Self-Hosting will enable to access the Service in the same System,

    This is not correct. You can host a WCF service in a windows service that can be accessed over TCP.

    More info here: http://msdn.microsoft.com/en-us/library/ff649818.aspx

    Thursday, July 4, 2013 6:51 PM
  • User-488622176 posted

    Sample here : http://www.codeproject.com/Articles/46335/Host-WCF-as-Windows-Service-without-Installing

    You can host in a Windows service, or in a default application (console, winforms, wpf, ...)

    Friday, July 5, 2013 9:41 AM
  • User269148008 posted

    Thanks for the reply Illeris!!

    I have a doubt, If we host the WCF Service in a system(Local System) using WAS/Self-Hosting Can I have an URI with which I can use the service in any other System(Client System) in the same network. 

    Monday, July 8, 2013 1:35 AM
  • User269148008 posted

    Hi Prashant,

    Thanks for reply, can we access through TCP?? Woow!!

    Now, I want to keep the question straight, If I host a WCF Service in Win Service/Self-Hosting, do we get any URI, through which I can consume the WCF Service in any Client Machine on the same Network.

    As we get a URI, when we host the WCF Service in IIS, the Service can be used in any client machine using the same URI, similarly any thing as such through Self-Hosting/ Hosting in Win Serivces.

    Monday, July 8, 2013 1:41 AM
  • User-488622176 posted

    you can host on any available port on the system. The URI could be somehting like: net.tcp://localhost:12345/MyService.svc. You determine this port yourself. it must be free.

    For TCP + SSL => you'll need to register the certificate for that port. It is a little much more complex then when you host on IIS using https as protocol.

    For accessing the service from other machines, use the net.tcp://servername:12345:MyService.svc URI, where <servername> is the machinename or domainname of the server hosting the windows service.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 8, 2013 7:32 AM