Yanshof
Yanshof

Reputation: 9926

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/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 ?

Upvotes: 0

Views: 541

Answers (2)

marc_s
marc_s

Reputation: 754628

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!

Upvotes: 1

Nima M
Nima M

Reputation: 718

You should use your machine's IP address or computer name instead of localhost.

http://ComputerName/MyService

Upvotes: 0

Related Questions