I've got a few problems configuring an ASP.NET Webapplication which hosts a WCF Service. And I've been searching quite a while now. There are quite a lot of results to be honest, and I'm not an expert with WCF. Mostly the solutions are either for the wsHttpBinding (which i don't use) or showing ErrorMessages not associated with the one I get.
This is what I want to accomplish:
Access the WCF Service only through https binding on specific port (eg. "https://example.org:5555/MyService.svc")
This is my current problem:
I can successfully access the service at "https://example.org:5555/MyService.svc"
BUT
I have to configure a http binding in IIS7.5 (it's sufficient if it points to the localhost and a nonsense port as long as it's configured...)
The error Message when making a get request on MyService.svc (with CustomErrors="Off")
Service 'CustomNamespace.MyService' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.
I do understand from that, that there might be some configuration missing. However why should it work if http and https binding in IIS are present, but not if only https binding is present?
My Question:
What are the steps necessary to be able to remove the http binding?
Any help will be truly appreciated :)
Additional Info:
- The service works fine on IIS 7.5. if a https binding (e.g. ip "All Unassigned" and port 5555) AND http binding (e.g. ip "::1"(localhost) and port 55555) are configured for the site.
- As soon as I do either of the following steps in IIS. The application stops working:
- Remove the http binding
- Set "Require SSL" in IIS -> "SSL Settings" to true.
Contents of ConfigFile:
="1.0"
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding>
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
</configuration>
Content of MyService.svc (simplified):
<%@ ServiceHost Service="CustomNamespace.MyServiceImpl" %>
Content of "MyServiceImpl.cs" (simplified)
namespace CustomNamespace {
public interface IMyService {
[OperationContract(Name = "doSomething", Action = "", ReplyAction = "*")]
[XmlSerializerFormat]
CustomReplyType DoSomething(CustomType request)
}
public class MyServiceImpl : IMyService {
public CustomReplyType DoSomething(CustomType request) {
return new CustomReplyType();
}
}
}