Question

When I enter the address of my service, I get to see the WSDL file. However, When I add a suffix to the URL, I get the error message: "endpoint not found". It's definitely due to something wrong with my service model declaration but after a few hours, I'm inclined to admit that it's beyond me.

I've made sure that the namespaces are correct as discussed here.

The first URL works. The other, don't.

http://---.azurewebsites.net/MyService.svc/
http://---.azurewebsites.net/MyService.svc/Ping
http://---.azurewebsites.net/MyService.svc/Ping/ (as suggested here)

In behaviors I've declared two behaviors - one for the end point and one for the service.

<behaviors>
  <endpointBehaviors>
    <behavior name="PingEndPointBehavior">
      <webHttp/>
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name ="PingServiceBehavior">
      <serviceMetadata httpGetEnabled="true"
                       httpsGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true"
                       httpsGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>

I declared the following binding for access via URL line in the browser.

<bindings>
  <webHttpBinding></webHttpBinding>
</bindings>

In services I declared two end points (I tested with only the first one, as well).

<service name="MyProject.MyService"
         behaviorConfiguration="PingServiceBehavior">
  <endpoint name="PingEndPoint"
            behaviorConfiguration="PingEndPointBehavior"
            address="Ping"
            binding="webHttpBinding"
            contract="MyProject.IMyService"/>
  <endpoint contract="IMetadataExchange" 
            binding="mexHttpBinding" 
            address="mex" />
</service>

I also have the following in my config file. Doubtful of its significance, but one never knows.

<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
                           multipleSiteBindingsEnabled="true"/>
Was it helpful?

Solution

I've resolved the issue. Apparently, the virtual path of sub-directories is cumulative, so the exposed service was there all along but at the following address.

http://---.azurewebsites.net/MyService.svc/Ping/Ping

One ping level comes from the config file while the other from the template URI in the attribute that decorates the interface for the method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top