0
votes

I'm new to C# environment and also new to IIS and WCF. I have created a WCF service and a client application. When client uses that WCF service by using localhost (Application development server), it works fine. Then I hosted that WCF service on IIS server on same machine. Now tell me: How to consume WCF service hosted on IIS server from a Windows application form? Please help me to resolve this issue.

UPDATE:

After hosting on IIS server the address I got:

http://mypcname/hello/service.svc

Then I have created a normal client application pc and gave reference of that service (http://mypcname/hello/service.svc). Whenever I send messages to the server, it shows error in service I have used database. I have to store data which I send to the server. It cannot access the database on IIS server.

What steps should I take to resolve this problem? Also tell me that how to interact over the network.

1

1 Answers

1
votes

You did not provide much detail, for example - where you hosted the WCF service before and how . I'm assuming you started with a console app host or something like this before moving the service to IIS?

If so - it depends how much you've changed in your service if anything at all, but generally it should be pretty much the same.

When you hosted the service in a local application you have most likely accessed it using http://localhost:[some port number]/something/somghting.svc

When moving to IIS, if everything is configured, and nothing else changed, the only difference would be the port number, which - presumably - is now 80, and therefore can be emitted, so your new url would be http://localhost/something/somghting.svc