问题描述
||
我正在尝试开发使用WCF服务的Windows Phone应用程序。我正在按照此处的说明进行操作:
http://www.c-sharpcorner.com/UploadFile/raj1979/5280/
(当然,我使用数据库中的表)。问题是:
我正在调试包含WCF服务的类库项目(以查看其某些方法是否被正确调用)
方法返回实体后,我看到错误:
There was no endpoint listening at http://localhost:1708/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.
InnerException是is1ѭ
Windows Phone应用程序中的ServiceReferences.ClientConfig
:
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name=\"BasicHttpBinding_IService1\" maxBufferSize=\"2147483647\"
maxReceivedMessageSize=\"2147483647\">
<security mode=\"None\" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address=\"http://localhost:1708/Service1.svc\" binding=\"basicHttpBinding\"
bindingConfiguration=\"BasicHttpBinding_IService1\" contract=\"ServiceReference1.IService1\"
name=\"BasicHttpBinding_IService1\" />
</client>
</system.serviceModel>
</configuration>
我不知道该怎么解决。有任何想法吗 ?我从该网站尝试了许多答案,但没有一个有效
解决方法
服务器端启用了Silverlight的WCF服务又如何呢?它基于CustomBinding而不是basicHttpBinding。
, 您必须将Windows Phone Emulator端点地址中的ServiceReferences.ClientConfig更改为localhost。
yourComputerName。就是这样:)