【发布时间】:2014-09-11 11:44:56
【问题描述】:
在 Silverlight 项目中发布并尝试访问服务 http://griduni.uninova.pt/sidac/Service/SilverlightWCF.svc 时会收到出现的错误消息。
我的 Web.config
<configuration>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.5">
</compilation>
<httpRuntime targetFramework="4.5" />
</system.web>
<system.serviceModel>
<!--<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://griduni.uninova.pt"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>-->
<!--<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />-->
<bindings>
<customBinding>
<binding name="ExampleTeste45.Web.Service.SilverlightWCF.customBinding0">
<binaryMessageEncoding />
<httpTransport />
</binding>
</customBinding>
</bindings>
<!--<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />-->
<services>
<service name="ExampleTeste45.Web.Service.SilverlightWCF"
behaviorConfiguration="SimpleServiceBehavior">
<endpoint address="" binding="customBinding"
bindingConfiguration="ExampleTeste45.Web.Service.SilverlightWCF.customBinding0"
contract="ExampleTeste45.Web.Service.SilverlightWCF" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="SimpleServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<!--<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />-->
</system.serviceModel>
</configuration>
我的服务标记:
<%@ ServiceHost Language="C#" Debug="true" Service="ExampleTeste45.Web.Service.SilverlightWCF" CodeBehind="SilverlightWCF.svc.cs" %>
我在谷歌看到的解决方案不起作用,标记中的 Service="ExampleTeste45.Web.Service.SilverlightWCF" 是正确的,端点地址根据定义是空白的,我看到它得到了正确的地址,那又如何我做错了吗?
【问题讨论】:
-
我也想知道你为什么评论了
-
它给出了另一个错误,因此发表评论以查看是否解决了问题,并且由于消除了正在显示的错误并构建解决方案没有出现错误,所以我让它保持评论
标签: c# web-services wcf silverlight