views:

171

answers:

5

I've made a WCF service. I want it's client to be able to access it from anywhere. How can I do that? Details:

  • I want it to be hosted in a Windows process, not a site.
  • I'm using TCP binding.
  • I don't know almost anything about web hosting etc.
  • It's desirable not to use IIS...

I have found many recommendations in the web, but still do not understand all the stuff. Please, tell me how to do it in details...

As I understand, it's necessary to make a global for the endpoint. I've configured port forwarding in my router to the 8000 port, but .. what's further? What address should I enter as the endpoint address? It's now localhost:8000.

A: 

You don't need IIS, you can self-host and it will be accessible via the internet.

Basically, when you self-host a WCF application, it is a server (just like a web-server such as Apache or IIS).

Here is a good website that discusses how to expose your own server to the internet.

http://www.diywebserver.com/

Keep in mind that you can skip any parts that have to do with setting up Apache, since you already have a server (your WCF application).

Arash
A: 

To me this question sounds like, "please help me write a program. I don't know anything about computers, and I would prefer not to use my keyboard."

What you ask is possible, but complex and you will need to learn a lot before you can get it to work the way you expect it to work.

Probably, you will also need to learn about web hosting if you want it to be accessible from anywhere.

BTW, follow the example here: http://msdn.microsoft.com/en-us/library/ms756474.aspx

tster
I dont agree that his question sounds like how you sum it up. It is a complex problem and hence he is stuck and get into trouble. He had made the attempt to brief on what he has and and avenues he took to find an answer but he still struggling to work it out. Isn't the whole purpose of this website is to post questions and sharing knowledge?
Fadrian Sudaman
A: 

As I answered in this related SO link, my suggestion is based on this codeproject.com example. It works well.

kenny
A: 

you need to have a public IP and a domain name. I would suggest renting a virtual server for your service and host it in windows service.

rerun
A: 

You will need a public IP address or domain name like suggested above. Find out if you already have it, if not follow the suggestions above on setting that up.

For your WCF host and client, you will need endpoint that look like this:

  • Host: net.tcp://localhost:portnum/servicename
  • Client: net.tcp://publicipORdomainname:portnum/servicename

You will need to make sure that your router route the port to the host PC. From the question sounds like you have done it correctly. Because the host is local, you dont have to change the endpoint to use public ip or domain name. The client needs to resolve the call to the host which resides on the remote address, hence need the addressable public IP.

Fadrian Sudaman