Search code examples
c#wcfwindows-store-appswcf-endpoint

WCF C# Windows Store APP I am getting this exception “There was no endpoint listening at [URL] that could accept the message…”


I made a WCF that connects SQL DB and get data to a Windows Store App... Yesterday worked just fine. I could get the data from the DB to the Client app. Today I open the solution again and for my surprise it just stop working just like that...

I 've been searching in foruns some ideias but didn't get any positive result.

I didn't change a single line of code, and I really don't know what is happening. I tried to make a new solution, a new project with that funcionality and nothing, just doesn't work. I tried to change the wcf app.config but without any success. Can someone please give me some ideias to solve it???

this is the my WCF app.congif file:

<?xml version="1.0" encoding="utf-8" ?> 
<configuration>
  <configSections>
  </configSections>
  <connectionStrings>
<add name="WcfBD.Properties.Settings.ProjetoFinalConnectionString"
  connectionString="Data Source=Asus;Initial Catalog=ProjetoFinal;Integrated Security=True"
  providerName="System.Data.SqlClient" />
  </connectionStrings>
  <appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>
  <system.web>
<compilation debug="true" />
</system.web>
  <system.serviceModel>
<services>
<service name="WcfBD.BaseDadosWCF">
<endpoint address="" binding="basicHttpBinding" contract="WcfBD.IBaseDadosWCF">
 <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8733/Design_Time_Addresses/WcfBD/Service1/" />
      </baseAddresses>
    </host>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior>
 <serviceDebug includeExceptionDetailInFaults="False" />
 </behavior>
 </serviceBehaviors>
</behaviors>
  </system.serviceModel>
</configuration>

Solution

  • I am sharing my WCF service configuration for your reference. you check your service contract

    <system.serviceModel>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="false"/>
    <services>
      <service behaviorConfiguration="ServiceBehaviour" name="DataService.DataService">
        <endpoint address="web" behaviorConfiguration="jsonBehavior" binding="webHttpBinding" bindingConfiguration="webHttpBindingWithJsonP" contract="DataService.IDataService"/>
         <endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding" contract="DataService.IDataService"  />
        <endpoint address="soap" binding="basicHttpBinding" contract="DataService.IDataService"/>
      </service>
    </services>
    <behaviors>
      <endpointBehaviors>
        <behavior name="jsonBehavior">
          <webHttp helpEnabled="true"  faultExceptionEnabled="True" defaultBodyStyle="Bare" defaultOutgoingResponseFormat="Xml"/>
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehaviour">
          <!-- To avoid disclosing metadata information, set the values below to false 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" httpHelpPageEnabled="True"/>
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <webHttpBinding>
        <binding name="webHttpBindingWithJsonP" crossDomainScriptAccessEnabled="true" allowCookies="true">
          <security mode="None"></security>
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
        </binding>
      </webHttpBinding>
     <wsHttpBinding>
        <binding name="wsHttpBinding" allowCookies="true">
          <security mode="None"></security>
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
              maxArrayLength="2147483647" maxBytesPerRead="2147483647"
              maxNameTableCharCount="2147483647" />
        </binding>
      </wsHttpBinding>
    </bindings>