1

I have a service file available in the following location.

C:\Documents and Settings\U16990\My Documents\Visual Studio 2010\Projects\CalculationService\CalculationService\CalculationService.svc

When I browse the svc file, it is working fine. The service endpoint is as listed below. It is currently a relative address used for address.

  <service name="CalculationService.CalculationService" behaviorConfiguration="MyServiceTypeBehaviors">
    <endpoint address="CalculationService" behaviorConfiguration=""
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_CalculationServiceInterface"
        contract="ICalculationService" />
  </service>

IP address of my machine is 10.10.179.180 //InterNetwork AddressFamily

When I change the address to use absolute path it is throwing error:

<services>
  <service name="CalculationService.CalculationService" behaviorConfiguration="MyServiceTypeBehaviors">
    <endpoint 
    address="http://10.10.179.180/C:/Documents and Settings/U16990/My Documents/Visual Studio 2010/Projects/CalculationService/CalculationService/CalculationService.svc/CalculationService"
    behaviorConfiguration=""
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_CalculationServiceInterface"
    contract="ICalculationService" />
  </service>
</services>

Error:: No protocol binding matches the given address 'http://10.10.179.180/C:/Documents and Settings/U16990/My Documents/Visual Studio 2010/Projects/CalculationService/CalculationService/CalculationService.svc/CalculationService'. Protocol bindings are configured at the Site level in IIS or WAS configuration. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

What can we do to correct it?

Note: I am testing the service with Visual Studio 2010.

Reference:

  1. Hosting a Simple Wcf Service in Console
  2. error "No protocol binding matches the given address ..."
  3. How to derive a website absolute file path from a WCF service hosted in IIS?
Community
  • 1
  • 1
LCJ
  • 22,196
  • 67
  • 260
  • 418

1 Answers1

3

An endpoint address is not a location of a file, but the URI at which the client can/will find the service. You should probably use something like this:

<service name="CalculationService.CalculationService" behaviorConfiguration="MyServiceTypeBehaviors">
    <endpoint 
        address="http://10.10.179.180/CalculationService/CalculationService.svc"
        behaviorConfiguration="" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_CalculationServiceInterface"
        contract="ICalculationService" />
</service>

In this case you're using a full URI instead of a relative one. In your client you must make sure that the endpoint refers to the same address, and you're good to go.

Jeroen
  • 60,696
  • 40
  • 206
  • 339