I have made a simple MVC project and added a .svc file to it and trying to call the function under the .svc file from another client project but every time i am getting the error for
Additional information: There was no endpoint listening at http://localhost:61787/Service1forImages.svc/GetData that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.r more details.
There is my client web.config file
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<configuration>
<configsections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework">
type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
requirePermission="false"/>
</section></configsections>
<connectionstrings>
<add name="DefaultConnection" connectionstring="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-testforWCFService-20160328043116.mdf;Initial Catalog=aspnet-testforWCFService-20160328043116;Integrated Security=True">
providerName="System.Data.SqlClient" />
</add></connectionstrings>
<appsettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appsettings>
<system.web>
<authentication mode="None" />
<compilation debug="true" targetframework="4.5.2" />
<httpruntime targetframework="4.5.2" />
</system.web>
<system.webserver>
<modules>
<remove name="FormsAuthentication" />
</modules>
</system.webserver>
<runtime>
<assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentassembly>
<assemblyidentity name="Microsoft.Owin.Security" publickeytoken="31bf3856ad364e35" />
<bindingredirect oldversion="1.0.0.0-3.0.1.0" newversion="3.0.1.0" />
</dependentassembly>
<dependentassembly>
<assemblyidentity name="Microsoft.Owin.Security.OAuth" publickeytoken="31bf3856ad364e35" />
<bindingredirect oldversion="1.0.0.0-3.0.1.0" newversion="3.0.1.0" />
</dependentassembly>
<dependentassembly>
<assemblyidentity name="Microsoft.Owin.Security.Cookies" publickeytoken="31bf3856ad364e35" />
<bindingredirect oldversion="1.0.0.0-3.0.1.0" newversion="3.0.1.0" />
</dependentassembly>
<dependentassembly>
<assemblyidentity name="Microsoft.Owin" publickeytoken="31bf3856ad364e35" />
<bindingredirect oldversion="1.0.0.0-3.0.1.0" newversion="3.0.1.0" />
</dependentassembly>
<dependentassembly>
<assemblyidentity name="Newtonsoft.Json" culture="neutral" publickeytoken="30ad4fe6b2a6aeed" />
<bindingredirect oldversion="0.0.0.0-6.0.0.0" newversion="6.0.0.0" />
</dependentassembly>
<dependentassembly>
<assemblyidentity name="System.Web.Optimization" publickeytoken="31bf3856ad364e35" />
<bindingredirect oldversion="1.0.0.0-1.1.0.0" newversion="1.1.0.0" />
</dependentassembly>
<dependentassembly>
<assemblyidentity name="WebGrease" publickeytoken="31bf3856ad364e35" />
<bindingredirect oldversion="1.0.0.0-1.5.2.14234" newversion="1.5.2.14234" />
</dependentassembly>
<dependentassembly>
<assemblyidentity name="System.Web.Helpers" publickeytoken="31bf3856ad364e35" />
<bindingredirect oldversion="1.0.0.0-3.0.0.0" newversion="3.0.0.0" />
</dependentassembly>
<dependentassembly>
<assemblyidentity name="System.Web.Mvc" publickeytoken="31bf3856ad364e35" />
<bindingredirect oldversion="1.0.0.0-5.2.3.0" newversion="5.2.3.0" />
</dependentassembly>
<dependentassembly>
<assemblyidentity name="System.Web.WebPages" publickeytoken="31bf3856ad364e35" />
<bindingredirect oldversion="1.0.0.0-3.0.0.0" newversion="3.0.0.0" />
</dependentassembly>
</assemblybinding>
</runtime>
<entityframework>
<defaultconnectionfactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantname="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityframework>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs">
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb">
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>
</compiler></compiler></compilers>
</system.codedom>
<system.servicemodel>
<!--<bindings>
<wshttpbinding>
<binding name="ota2010AEndpoint" 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="Transport">
<transport clientcredentialtype="None" proxycredentialtype="None">
realm="" />
<message clientcredentialtype="Windows" negotiateservicecredential="true">
establishSecurityContext="true" />
</message></transport></security>
</reliablesession></readerquotas></binding>
</wshttpbinding>
</bindings>-->
<behaviors>
<endpointbehaviors>
<behavior name="restfulBehavior">
<webhttp />
</behavior>
</endpointbehaviors>
</behaviors>
<client>
<!--<endpoint address="http://localhost:57608/Service1.svc" binding="wsHttpBinding" bindingconfiguration="ota2010AEndpoint" contract="ExternalService.IService1" name="IPresidentsService" kind="" endpointconfiguration="" behaviorconfiguration="restfulBehavior">
<identity>
<dns value="localhost" />
<certificatereference storename="My" storelocation="LocalMachine" x509findtype="FindBySubjectDistinguishedName" />
</identity>
</endpoint>-->
<endpoint address="http://localhost:61787/Service1forImages.svc" binding="webHttpBinding" bindingconfiguration="" contract="ServiceReference1.IService1forImages" name="IPresidentsService" kind="" endpointconfiguration="" behaviorconfiguration="restfulBehavior">
<identity>
<dns value="localhost" />
<certificatereference storename="My" storelocation="LocalMachine" x509findtype="FindBySubjectDistinguishedName" />
</identity>
</endpoint>
</client>
</system.servicemodel>
</configuration>
This is my Service web.config file
<system.servicemodel>
<behaviors>
<endpointbehaviors>
<behavior name="webHttpEnablingBehaviour">
<webhttp />
</behavior>
</endpointbehaviors>
<servicebehaviors>
<behavior name="webHttpEnablingBehaviour">
<servicemetadata httpgetenabled="true" httpsgetenabled="true" />
<servicedebug includeexceptiondetailinfaults="false" />
</behavior>
</servicebehaviors>
</behaviors>
<services>
<service name="Web.DynamicImage.Service1forImages" behaviorconfiguration="webHttpEnablingBehaviour">
<endpoint address="" behaviorconfiguration="webHttpEnablingBehaviour" binding="webHttpBinding" contract="Web.DynamicImage.IService1forImages">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseaddress="http://localhost:61787/Service1forImages.svc" />
</baseAddresses>
</host>
</service>
</services>
</system.servicemodel>
What I have tried:
I have trying to call same service with a wcf project it is working well but when i calling a adding a single .svc file to project and calling its function it is generating errors.