I am new to the WCF world. I've done plenty of the old style ASMX services.
What I am trying to do is get my feet wet with WCF. I can create one just fine, and it runs on my non SSL box. When I deploy this same test to an SSL box I get an error. I've done some searching and changed my web.config a few times but I still get the
same error when I browse to my service.svc?wsdl
Service 'WCFTest.Service' 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.
Here is my web.config. I've even gone so far as to copy it and rename the copy app.config.
Part of Step 2 helped, specifically, adding the transport client credentials. I get a different message now, which looks related to IIS' authentication scheme. Thank you very much. I also changed my service name setting and contract. I changed the service
name to be Namespace.SERVICENAME and the contract to be Namespace.INTERFACENAME.
SheldonS
Member
35 Points
21 Posts
WCF over SSL
Oct 24, 2011 08:05 PM|LINK
I am new to the WCF world. I've done plenty of the old style ASMX services.
What I am trying to do is get my feet wet with WCF. I can create one just fine, and it runs on my non SSL box. When I deploy this same test to an SSL box I get an error. I've done some searching and changed my web.config a few times but I still get the same error when I browse to my service.svc?wsdl
Service 'WCFTest.Service' 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.
Here is my web.config. I've even gone so far as to copy it and rename the copy app.config.
<?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> <customErrors mode="Off"></customErrors> </system.web> <system.serviceModel> <services> <service name="MyService"> <endpoint address="" binding="wsHttpBinding" bindingConfiguration="sslBinding" contract="IService" /> </service> </services> <behaviors> <serviceBehaviors> <behavior> <serviceMetadata httpGetEnabled="true"/><!--I've also tried httpsGetEnabled--> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> <bindings> <wsHttpBinding> <binding name="sslBinding"> <security mode="Transport"></security> </binding> </wsHttpBinding> </bindings> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>My non SSL box is 64-bit Windows 2008R2, my SSL box is 32-bit Windows 2003R2. Does that make a big difference?
ssl WCF
kushalrdalal
Contributor
4930 Points
909 Posts
Re: WCF over SSL
Oct 24, 2011 08:29 PM|LINK
After this try to add -
Then try is it working.My Blog
LinkedIn Profile
SheldonS
Member
35 Points
21 Posts
Re: WCF over SSL
Oct 24, 2011 08:36 PM|LINK
Thank you for the quick suggestion. I get the same error though.
<?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> <customErrors mode="Off"></customErrors> </system.web> <system.serviceModel> <services> <service name="MyService"> <endpoint address="" binding="wsHttpBinding" bindingConfiguration="sslBinding" contract="IService" /> <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/> </service> </services> <behaviors> <serviceBehaviors> <behavior> <serviceMetadata httpsGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> <bindings> <wsHttpBinding> <binding name="sslBinding"> <security mode="Transport"></security> </binding> </wsHttpBinding> </bindings> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>kushalrdalal
Contributor
4930 Points
909 Posts
Re: WCF over SSL
Oct 24, 2011 09:57 PM|LINK
Did you set it up in your IIs as well?
Check this link if it can help -
http://www.codeproject.com/KB/WCF/7stepsWCF.aspx
My Blog
LinkedIn Profile
SheldonS
Member
35 Points
21 Posts
Re: WCF over SSL
Oct 25, 2011 01:08 PM|LINK
GREAT!
Part of Step 2 helped, specifically, adding the transport client credentials. I get a different message now, which looks related to IIS' authentication scheme. Thank you very much. I also changed my service name setting and contract. I changed the service name to be Namespace.SERVICENAME and the contract to be Namespace.INTERFACENAME.
<?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> <customErrors mode="Off"></customErrors> </system.web> <system.serviceModel> <services> <service name="WCFTest.Service"> <endpoint address="" binding="wsHttpBinding" bindingConfiguration="sslBinding" contract="WCFTest.IService" /> <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/> </service> </services> <behaviors> <serviceBehaviors> <behavior> <serviceMetadata httpsGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> <bindings> <wsHttpBinding> <binding name="sslBinding"> <security mode="Transport"> <transport clientCredentialType="None" /> </security> </binding> </wsHttpBinding> </bindings> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>