WCF C#Windows应用商店APP我得到这个例外,“没有终点在[URL],可以接受邮件听......” [英] WCF C# Windows Store APP I am getting this exception “There was no endpoint listening at [URL] that could accept the message…”

查看:206
本文介绍了WCF C#Windows应用商店APP我得到这个例外,“没有终点在[URL],可以接受邮件听......”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个连接SQL数据库,并获取数据到Windows Store应用一个WCF ......昨天的工作只是罚款。我可以从DB数据到客户端应用程序。今天,我再次打开该解决方案,并为我吃惊的是它只是停止工作就这样...



我一直在寻找一些foruns但ideias没有得到任何阳性结果。



我没有改变的一行代码,我真的不知道发生了什么。我试图让一个新的解决方案,与的funcionality并没有什么新的项目,是行不通的。
我试图改变WCF app.config中,但没有成功。
能有人请给我一些ideias解决呢?



这是我的WCF app.congif文件:

 < ;?XML版本=1.0编码=UTF-8>?; 
<结构>
< configSections>
< / configSections>
<&是connectionStrings GT;
<添加名称=WcfBD.Properties.Settings.ProjetoFinalConnectionString
的connectionString =数据源=华硕;初始目录= ProjetoFinal;集成安全性=真
的providerName =System.Data这.SqlClient/>
< /&是connectionStrings GT;
<&的appSettings GT;
<添加键=ASPNET:UseTaskFriendlySynchronizationContextVALUE =真/>
< /的appSettings>
<&的System.Web GT;
<编译调试=真/>
< /system.web>
< system.serviceModel>
<服务和GT;
<服务名称=WcfBD.BaseDadosWCF>
<端点地址=绑定=basicHttpBinding的合同=WcfBD.IBaseDadosWCF>
<同一性GT;
< DNS值=本地主机/>
< /身份>
< /端点>
<端点地址=MEX绑定=mexHttpBinding合同=IMetadataExchange接口/>
<主机>
< baseAddresses>
<添加baseAddress =HTTP://本地主机:8733 / Design_Time_Addresses / WcfBD /服务1 //>
< / baseAddresses>
< /主机>
< /服务>
< /服务>
<&行为GT;
< serviceBehaviors>
<&行为GT;
< serviceDebug includeExceptionDetailInFaults =FALSE/>
< /行为>
< / serviceBehaviors>
< /行为>
< /system.serviceModel>
< /结构>


解决方案

我分享我的WCF服务的配置供您参考。你检查你的服务合同。



 < system.serviceModel> 
< serviceHostingEnvironment multipleSiteBindingsEnabled =真aspNetCompatibilityEnabled =FALSE/>
<服务和GT;
<服务behaviorConfiguration =ServiceBehaviourNAME =DataService.DataService>
<端点地址=网络behaviorConfiguration =jsonBehavior绑定=的WebHttpBindingbindingConfiguration =webHttpBindingWithJsonP合同=DataService.IDataService/>
<端点地址=绑定=的wsHttpBindingbindingConfiguration =的wsHttpBinding合同=DataService.IDataService/>
<端点地址=肥皂绑定=basicHttpBinding的合同=DataService.IDataService/>
< /服务>
< /服务>
<&行为GT;
< endpointBehaviors>
<行为NAME =jsonBehavior>
< webHttp helpEnabled =真faultExceptionEnabled =真defaultBodyStyle =裸defaultOutgoingResponseFormat =XML/>
< /行为>
< / endpointBehaviors>
< serviceBehaviors>
<行为NAME =ServiceBehaviour>
<! - 为了避免泄露的元数据信息,在部署之前设置以下为false值 - >
< serviceMetadata httpGetEnabled =真/>
<! - 要接收的异常细节的故障进行调试,下面设置为true值。设置为false部署之前,以避免泄露异常信息 - >
< serviceDebug includeExceptionDetailInFaults =真httpHelpPageEnabled =真/>
< DataContractSerializer的maxItemsInObjectGraph =2147483647/>
< /行为>
< / serviceBehaviors>
< /行为>
<&绑定GT;
<&的WebHttpBinding GT;
<绑定名称=webHttpBindingWithJsonPcrossDomainScriptAccessEnabled =真allowCookies =真>
<安全模式=无>< /安全>
< readerQuotas MAXDEPTH =2147483647maxStringContentLength =2147483647maxArrayLength =2147483647maxBytesPerRead =2147483647maxNameTableCharCount =2147483647/>
< /&结合GT;
< /&的WebHttpBinding GT;
<&的wsHttpBinding GT;
<绑定名称=的wsHttpBindingallowCookies =真>
<安全模式=无>< /安全>
< readerQuotas MAXDEPTH =2147483647maxStringContentLength =2147483647
maxArrayLength =2147483647maxBytesPerRead =2147483647
maxNameTableCharCount =2147483647/>
< /&结合GT;
< /&的wsHttpBinding GT;
< /绑定>




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>

解决方案

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>

这篇关于WCF C#Windows应用商店APP我得到这个例外,“没有终点在[URL],可以接受邮件听......”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆