ghj Grandhe
asked on
Receving error as system.servicemodel.endpointnotfoundexception there was no endpoint listening at http://localhost:8080/Service1.svc
This is my web.config file:
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
https://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.6.1"/>
<httpRuntime targetFramework="4.6.1"/>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
type="Microsoft.CodeDom.Pr oviders.Do tNetCompil erPlatform .CSharpCod eProvider, Microsoft.CodeDom.Provider s.DotNetCo mpilerPlat form, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35"
warningLevel="4" compilerOptions="/langvers ion:defaul t /nowarn:1659;1699;1701"/>
<compiler language="vb;vbs;visualbas ic;vbscrip t" extension=".vb"
type="Microsoft.CodeDom.Pr oviders.Do tNetCompil erPlatform .VBCodePro vider, Microsoft.CodeDom.Provider s.DotNetCo mpilerPlat form, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35"
warningLevel="4" compilerOptions="/langvers ion:defaul t /nowarn:41008 /define:_MYTYPE=\"Web \" /optionInfer+"/>
</compilers>
</system.codedom>
<system.webServer>
<directoryBrowse enabled="true"/>
</system.webServer>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISe rvice1" >
</binding>
</basicHttpBinding>
<netTcpBinding>
<binding name="NetTcpBinding_IServi ce1" />
</netTcpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8080/Service1.svc"
binding="basicHttpBinding" bindingConfiguration="Basi cHttpBindi ng_IServic e1"
contract="ServiceReference 1.IService 1" name="BasicHttpBinding_ISe rvice1" />
<endpoint address="net.tcp://localho st:8090/Se rvice1.svc /MyService "
binding="netTcpBinding" bindingConfiguration="NetT cpBinding_ IService1"
contract="ServiceReference 1.IService 1" name="NetTcpBinding_IServi ce1">
<identity>
<userPrincipalName value="PC\Admin" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
And this is in asp.net webapplication iam consuming the service
using System;
using System.Collections.Generic ;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace ConsumptionOfWCF
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
ServiceReference1.Service1 Client client= new ServiceReference1.Service1 Client("Ba sicHttpBin ding_IServ ice1");
Label1.Text=client.Message (TextBox1. Text);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
https://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.6.1"/>
<httpRuntime targetFramework="4.6.1"/>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
type="Microsoft.CodeDom.Pr
warningLevel="4" compilerOptions="/langvers
<compiler language="vb;vbs;visualbas
type="Microsoft.CodeDom.Pr
warningLevel="4" compilerOptions="/langvers
</compilers>
</system.codedom>
<system.webServer>
<directoryBrowse enabled="true"/>
</system.webServer>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISe
</binding>
</basicHttpBinding>
<netTcpBinding>
<binding name="NetTcpBinding_IServi
</netTcpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8080/Service1.svc"
binding="basicHttpBinding"
contract="ServiceReference
<endpoint address="net.tcp://localho
binding="netTcpBinding" bindingConfiguration="NetT
contract="ServiceReference
<identity>
<userPrincipalName value="PC\Admin" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
And this is in asp.net webapplication iam consuming the service
using System;
using System.Collections.Generic
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace ConsumptionOfWCF
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
ServiceReference1.Service1
Label1.Text=client.Message
}
}
}
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.