I have been using WCF for a few years now and am fairly comfortable with it, however there is one simple WCF concept that I have yet to employ and am having difficulties with it.
Following this article about WCF addressing as it specifically relates to multiple endpoints in IIS I see these two excerpts:
"Suppose you have a file named calc.svc and you place it in a virtual directory that corresponds to (http://localhost:8080/calcservice). The base address for this service will be (http://localhost:8080/calcservice/calc.svc)."
and
"Now, consider the endpoint configuration found in the virtual directory’s web.config file (in Figure 3). In this case, the address of the first endpoint becomes the same as the base address (http://localhost:8080/calcservice/calc.svc) since I left the endpoint address empty. The address of the second endpoint becomes the combination of the base address appended with "secure", like this: (http://localhost:8080/calcservice/calc.svc/secure)."
Now in my application I'm trying to create two endpoints for the same service (shown below). The service name is MainService.svc. For endpoint one I have address="" and endpoint two has address="Soap11". Bringing the site up in IIS I can successfully hit this URL: (https://localhost:444/MainService.svc). This is the base address for the service according to all the documentation I can find. According to this article and others I have seen that confirm its information I should have the second endpoint at (https://localhost:444/MainService.svc/Soap11) but if I navigate to that URL I get a .Net exception indicating the resource is not found.
Is there a tool I can use to see where my different endpoints will be available? Maybe some IIS or aspnet_isapi.dll logging I can turn on? My web.config section defining my endpoints follows.
Thanks in advance for your help
<service behaviorConfiguration="MyService.MainServiceBehavior" name="MyService.MainService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="WSBindingConfig" contract="MyService.IMainService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="Soap11" binding="basicHttpBinding" bindingConfiguration="BasicBindingWithCredentials"
contract="MyService.IMainService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
Looking further I see that the WSDL does reference these two endpoints and in the places I expect to find them. I am still having difficulty using them however. This is what the service has in it:
<wsdl:service name="MainService">
<wsdl:port name="WSHttpBinding_IMainService" binding="tns:WSHttpBinding_IMainService">
<soap12:address location="https://localhost/MainService.svc/Soap12" />
<wsa10:EndpointReference>
<wsa10:Address>https://localhost/MainService.svc/Soap12</wsa10:Address>
<Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
<Dns>localhost</Dns>
</Identity>
</wsa10:EndpointReference>
</wsdl:port>
<wsdl:port name="BasicHttpBinding_IMainService" binding="tns:BasicHttpBinding_IMainService">
<soap:address location="https://localhost/MainService.svc/Soap11" />
</wsdl:port>
</wsdl:service>
Trying to point my client at either URL (https://localhost/MainService.svc/Soap11 or Soap12) however does not work. I get an "Internal Server Error 500" as a base exception with "The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8)" as the outermost exception.