tags:

views:

132

answers:

2

Hi

I hope this is a quick question. I have a WCF service running on IIS port 4040. I have added the following headers to this service

4040 (non load balanced domain)

4040 localhost

So locally I can reference this service as http://localhost%3A4040/service.svc and also by the fully qualified domain name. This is no problem for all the services on this machine, I can reference everything by localhost:4040

The issue comes when I try to access it from another server (as we have other apps that need to consume the service)

I get a 404 error, and was wondering whether the service is defaulting to being exposed on localhost loopback (127.0.0.1) therefore cannot be accessed.

The endpoint is defined as such:

 <service behaviorConfiguration="ClaimChaseBehavior"
          name="Modules.EClaims.ClaimChase">
    <endpoint address=""
              binding="basicHttpBinding"
              contract="Domain.EClaims.DataInterfaces.IClaimChase" />
    <endpoint address="mex" binding="mexHttpBinding" 
              contract="IMetadataExchange" />
 </service>

Notice I don't define an address. The reason for this is to allow us to have a common config file (we are trying to get around defining machine domains/addresses and thus multiple configs)

Is there a way to make the WCF default to the machine IP instead of the loopback connector without defining the actual domain name

Hope this makes sense

Regards

Richard

A: 

Check your web config. Have you spesified that the address of the service is localhost?

EDIT:

On second thoughts, it looks like a firewall problem, is port 4040 blocked by a local firewall?

Shiraz Bhaiji
Hi Shiraz thanks for your comment, my config wasn;t being displayed. I dont define anything in the address parameter as you can see. Are you recommending I do this?
+1  A: 

When you're hosting your service in IIS, the address of the service is defined and controlled by the location of your *.svc file - you cannot override that by defining base addresses or explicit address on your service endpoints.

The service address will always be:

http://machinename/VirtualDirectory/YourService.svc

Marc

marc_s