I am getting the following error and it is driving me mad. It is almost as if WCF is deliberately made confusing and complicated just to annoy people!
"There was no endpoint listening at https://mymachine/TestService/Service1.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."
My Web config for the service is as follows
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="testbinding">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="Service1">
<endpoint address="https://mymachine/TestService/Service1.svc"
binding="basicHttpBinding" bindingConfiguration="testbinding"
name="testendpoint" contract="IService1" />
<host>
<baseAddresses>
<add baseAddress="http://mymachine" />
<add baseAddress="https://mymachine" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
However it still produces the same error. (I did get a warning about the test ssl certificate though from Visual studio when updating my service reference, which suggests the https part is now working properly.
You are probably using a dev certificate which is actually generates this error when using the transport security setting. You need to add a certificate policy on dev only to account for the dev/invalid certificate. read more here:
Ok, thanks, I added this code and it still produces the same error. I put a break point in the RemoteCertValidate method of the code on from the link and it does hit it and therefore return true for the certificate validation. But still no endpoint listening
apparently........
You can try to add another httpbasic enpoint with security mode=none to the server and update your client proxy. This allows you to test the connection without the certificate. If this works, you then isolated the problem to the HTTPS/certificate webserver
settings. Can you load the wsdl page under https?
coolblue
Participant
1087 Points
502 Posts
no endpoint listening
Nov 03, 2012 10:15 PM|LINK
I am getting the following error and it is driving me mad. It is almost as if WCF is deliberately made confusing and complicated just to annoy people!
"There was no endpoint listening at https://mymachine/TestService/Service1.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."
My Web config for the service is as follows
<?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="testbinding"> <security mode="Transport" /> </binding> </basicHttpBinding> </bindings> <services> <service name="Service1"> <endpoint address="https://mymachine/TestService/Service1.svc" binding="basicHttpBinding" bindingConfiguration="testbinding" name="testendpoint" contract="IService1" /> <host> <baseAddresses> <add baseAddress="http://mymachine" /> <add baseAddress="https://mymachine" /> </baseAddresses> </host> </service> </services> <behaviors> <serviceBehaviors> <behavior> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>And the app.config for the client application
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="TestServiceBindingConfig"> <security mode="Transport" /> </binding> <binding name="BasicHttpBinding_IService1" /> </basicHttpBinding> </bindings> <client> <endpoint address="https://mymachine/TestService/Service1.svc" binding="basicHttpBinding" bindingConfiguration="TestServiceBindingConfig" contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" /> </client> </system.serviceModel> </configuration>What on earth am I doing wrong?
chintan.jani
Member
26 Points
3 Posts
Re: no endpoint listening
Nov 05, 2012 09:31 AM|LINK
Here there are 2 items which you should change,
<serviceMetadata httpGetEnabled="true"/>
to
<serviceMetadata httpsGetEnabled="true"/>
you need to enable HTTP(S) as you are trying to expose end point with HTTPS
Also add the metadata exchange tag,
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
after your end point configuration on server
so it will be,
<endpoint address="https://mymachine/TestService/Service1.svc"
binding="basicHttpBinding" bindingConfiguration="testbinding"
name="testendpoint" contract="IService1" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
This two changes should solve your problem.
Let me know if it doenst work. Please mark as answer if it solves.
Regards,
Chintan
config WCF
coolblue
Participant
1087 Points
502 Posts
Re: no endpoint listening
Nov 05, 2012 01:37 PM|LINK
Ok, I have changed my web.config of the service to
<?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="testbinding"> <security mode="Transport" /> </binding> </basicHttpBinding> </bindings> <services> <service name="Service1"> <endpoint address="https://mymachine/TestService/Service1.svc" binding="basicHttpBinding" bindingConfiguration="testbinding" name="testendpoint" contract="IService1" /> <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="http://mymachine" /> <add baseAddress="https://mymachine" /> </baseAddresses> </host> </service> </services> <behaviors> <serviceBehaviors> <behavior> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpsGetEnabled="true"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>And my App.config off the client app is
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="TestServiceBindingConfig"> <security mode="Transport" /> </binding> <binding name="BasicHttpBinding_IService1" /> </basicHttpBinding> </bindings> <client> <endpoint address="https://mymachine/TestService/Service1.svc" binding="basicHttpBinding" bindingConfiguration="TestServiceBindingConfig" contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" /> </client> </system.serviceModel> </configuration>However it still produces the same error. (I did get a warning about the test ssl certificate though from Visual studio when updating my service reference, which suggests the https part is now working properly.
config WCF
ozkary
Contributor
2034 Points
303 Posts
Re: no endpoint listening
Nov 07, 2012 02:51 AM|LINK
You are probably using a dev certificate which is actually generates this error when using the transport security setting. You need to add a certificate policy on dev only to account for the dev/invalid certificate. read more here:
http://ozkary.blogspot.com/2012/11/there-was-no-endpoint-listening-wcf.html
I hope this helps
og-bit.com
coolblue
Participant
1087 Points
502 Posts
Re: no endpoint listening
Nov 07, 2012 01:42 PM|LINK
Ok, thanks, I added this code and it still produces the same error. I put a break point in the RemoteCertValidate method of the code on from the link and it does hit it and therefore return true for the certificate validation. But still no endpoint listening apparently........
ozkary
Contributor
2034 Points
303 Posts
Re: no endpoint listening
Nov 08, 2012 12:44 PM|LINK
You can try to add another httpbasic enpoint with security mode=none to the server and update your client proxy. This allows you to test the connection without the certificate. If this works, you then isolated the problem to the HTTPS/certificate webserver settings. Can you load the wsdl page under https?
You can add tracing on the server side to see why the connection is dropping. Follow this link for information on adding message logging: http://ozkary.blogspot.com/2011/06/wcf-security-token-in-message-could-not.html
og-bit.com