Click here to Skip to main content
16,004,452 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I developed a web application and wcf services. I added wcf reference to web application.After executing the project,it shows error like,


There was no endpoint listening at http://localhost:3331/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.

Please give me any suggestions...

This is the web.config on the WCF client project:

<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionstrings>
<add name="ApplicationServices" connectionstring="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providername="System.Data.SqlClient">
<add name="FirstGuardianConnectionString" connectionstring="Data Source=SYSTEM1;Initial Catalog=FirstGuardian;User ID=sa" providername="System.Data.SqlClient">

<system.web>
<compilation debug="true" targetframework="4.0">
<assemblies>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089">


<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880"/>

<membership>
<providers>
<clear>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionstringname="ApplicationServices" enablepasswordretrieval="false" enablepasswordreset="true" requiresquestionandanswer="false" requiresuniqueemail="false" maxinvalidpasswordattempts="5" minrequiredpasswordlength="6" minrequirednonalphanumericcharacters="0" passwordattemptwindow="10" applicationname="/">


<profile>
<providers>
<clear>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionstringname="ApplicationServices" applicationname="/">


<rolemanager enabled="false">
<providers>
<clear>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionstringname="ApplicationServices" applicationname="/">
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationname="/">



<system.net>
<connectionmanagement>
<add maxconnection="200" address="*">


<system.webserver>
<modules runallmanagedmodulesforallrequests="true">

<system.servicemodel>
<bindings>
<wshttpbinding>
<binding name="WSHttpBinding_IService1" closetimeout="00:01:00">
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerquotas maxdepth="32" maxstringcontentlength="8192" maxarraylength="16384">
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliablesession ordered="true" inactivitytimeout="00:10:00">
enabled="false" />
<security mode="Message">
<transport clientcredentialtype="Windows" proxycredentialtype="None"> realm="" />
<message clientcredentialtype="Windows" negotiateservicecredential="true">
algorithmSuite="Default" />




<client>
<endpoint address="http://localhost:3331/Service1.svc" binding="wsHttpBinding">
bindingConfiguration="WSHttpBinding_IService1" contract="ServiceReference1.IService1"
name="WSHttpBinding_IService1">
<identity>
<dns value="localhost">



<behaviors>
<servicebehaviors>
<behavior name="">
<servicemetadata httpgetenabled="true">
<servicedebug includeexceptiondetailinfaults="false">



<servicehostingenvironment multiplesitebindingsenabled="true">



And here is the web.config on the WCF service:

<configuration>
<appsettings>
<connectionstrings>
<add name="FirstGuardianConnectionString" connectionstring="Data Source=SYSTEM1;Initial Catalog=FirstGuardian;User ID=sa" providername="System.Data.SqlClient">

<system.web>
<compilation debug="true" targetframework="4.0">
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows">
<!--
The <customerrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customerrors mode="RemoteOnly" defaultredirect="GenericErrorPage.htm">
<error statuscode="403" redirect="NoAccess.htm">
<error statuscode="404" redirect="FileNotFound.htm">

-->
<pages controlrenderingcompatibilityversion="3.5" clientidmode="AutoID">

<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.servicemodel>
<services>
<service name="WcfService1.Service1" behaviorconfiguration="WcfService1.Service1Behavior">
<!-- Service Endpoints -->
<endpoint address="" binding="wsHttpBinding" contract="WcfService1.IService1">
<!--
Upon deployment, the following identity element should be removed or replaced to reflect the
identity under which the deployed service runs. If removed, WCF will infer an appropriate identity
automatically.
-->
<identity>
<dns value="localhost">


<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange">


<behaviors>
<servicebehaviors>
<behavior name="WcfService1.Service1Behavior">
<!-- 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="false">







Thanks&Regards,
swathi
Posted

I am not able to see your configuration properly, what i understood is that you have WSHttp configuration at client side and no endpoint configured at server(WCF service) side. Either use plain http binding at client side or configure an endpoint for WsHttp binding at server side.

Here what happens is that your client is configured to use WsHttp binding and when it requests server with wshttp binding, it is not able to find such an end point at server side. You have to add an endpoint at serverside, which is of type wshttp.
Or
The default is http binding so if you can change client configuration to use http binding, then it will work without modifying server configuration. This will solve your problem.

If not, then please copy your config file here(properly).
Please mark this solution as closed/fixed if this solves your problem
 
Share this answer
 
v3
Make sure that your wcf service is running while you are requesting the service.
 
Share this answer
 
Comments
ya....its working fine.But when i am executing the project,it shows error...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900