What i need to do to have the ability to access my WCF service from local network?
I'm new in the WCF and in the web developing ..
I wrote WCF service and i by creating new Web Sites - i added new WCF service that will host my WCF service.
In the 'Web location' i define the service to be HTTP and the URL to be "http://localhost开发者_StackOverflow中文版/MyService"
Now i want to access thru some other machine ( in the same network ) to my machine and get using the Service method that my WCF service exposed - but i fail each time ( calling from the second machine "http://a.b.c.d/MyService/interfaceMethodName")
If i try to call the web service thru the same machine - i get the right response.
What i missing ?
It sounds as if you're hosting your WCF service inside IIS, correct??
If so, then IIS dictates your service address - you cannot choose it at will.
The address will be:
http://YourServerName/YourVirtualDirectory/YourServiceFile.svc
You do have a SVC file, right? Can you connect to the above URL (adapted to your own setup, of course! What I wrote is just a template / sample)
Also: can you please show us your server-side config? The web.config
and inside it - the section <system.serviceModel>
. Please update your original question with that additional info by editing it - thanks!
You should use your machine's IP address or computer name instead of localhost.
http://ComputerName/MyService
精彩评论