0

I'm looking to have a WCF service that is self-hosted (No IIS!) Because I want to handle the data directly between to projects and not use a DB.

Basicly what i need is a service that is listening to lets say:

http:/My-Public-IP/ServiceName/MethodName/

and when a user creates and HTTP Request to that address something happens, I want to be able to catch in debug mode so lets say I have an Operation Contract Called Ping:

public string Ping()
{
 return "Ping";
}

when the user creates an HTTP REQUEST he will get to that method and so on...

My Question is what it the best design to do that, please keep in mind that this service is supposed to be accessible from all over the world, and is located on my Desktop, I know I need to open ports and stuff, but that I can Handle.

I need from you guys suggestions on how to design such A project and if you have tutorials, example,articles or any data on the subject I'll be more than thankful.

thanks in advance.

Bob Yaris
  • 19
  • 1
  • 6
  • 1
    A [search query](https://www.google.co.uk/search?q=wcf+tutorial+self+hosted) brings a lot of examples. Opening a port in the wild Internet for a self-hosted WCF service based on HTTP only protocol is a sure way to commit seppuku. – oleksii Mar 24 '13 at 12:24
  • That I know to do, I'm looking for some more information something more specific about the design and some info about how to do so – Bob Yaris Mar 24 '13 at 20:07
  • There is no difference in design of an IIS, Windows Service or a self-hosted app: define ABC: address, binding and contract. It's not important how you would host the app. – oleksii Mar 24 '13 at 20:32
  • and would i be able to access it through another computer that it's not on my network? – Bob Yaris Mar 24 '13 at 20:50
  • If you can configure networking - that is a totally separate issue. If this is a Windows machine I would do the following: find a public facing IP address, allow port and configure NATing. If public IP is 8.8.8.8 and a public port is 8888, a private address is 192.168.0.123, a private port is 80, then a NAT rule will route traffic from 8.8.8.8:8888 => 192.168.0.123:80. But this is just a guess, I am not sure what is your networking like – oleksii Mar 24 '13 at 21:57
  • ok, thanks, btw i cant mark your answer – Bob Yaris Mar 24 '13 at 22:22

1 Answers1

0

Whatever process you're using will need to create instances of the ServiceHost class. That's the core class that actually take care of recieveing, dispatching messages, instantiation of service instantes, etc.