How to consume a wcf service hosted on a remote machine?
Hi All I have 开发者_Go百科written a wcf service and hosted it on windows service. This windows service is started and running on a machine say 'A'. Now I wanted to write a client application on another machine say 'B' and wanted to consume the wcf servie on machine 'A'. For this when I tried to add Service reference, I have given the endpoint address of the wcf service on machine 'A'which is "http://localhost:8733/Design_Time_Addresses/NebulaDataModelService/Service1/".
But it could not be added giving the error "No connection could be made...".
Can anyone tell me how should I define the endpoint address of a wcf service so that it can be consumed by clients from different machines?
Thanks in advance
Normally you do not have to do anything special with the endpoint addess on the server to be able to consume it in a client.
The problem could be a number of things:
- wrong url (is it WCF 4? otherwise you probably need to specify the .svc file at the end of your service) -> change the url to include the .svc file at the end (e.g. Service1.svc)
- firewall on machine 'A' is blocking port 8733 (if you get an error with 'actively refused...' in it, this could be the case)
- easiest way to test this in a browser is by adding ?wsdl at the end of your url, if that works and show you an xml file, the service is reachable
精彩评论