【发布时间】:2012-09-11 16:37:47
【问题描述】:
我正在尝试从我的 Silverlight 应用程序中访问自托管 WCF 服务,但它无法正常工作。该服务配置为使用 SSL,我可以使用 WCFTestClient 工具、Web 浏览器来访问它,我可以引用该服务并从 silverlight 项目中更新它。问题是当 silverlight 应用程序尝试调用服务时,它会出现以下错误:
服务器没有提供有意义的回复;这可能是由于合同不匹配、会话过早关闭或内部服务器错误造成的。
当我使用 WCF 测试客户端工具点击它时,它返回的数据没有问题(如预期的那样)。
有什么想法吗?
以下是我的应用配置:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttp" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="6553600" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="Transport">
</security>
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="webHttp" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="6553600" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="Transport">
</security>
</binding>
</webHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
<service name="Application.ServiceModel.ApplicationService" behaviorConfiguration="serviceBehavior">
<host>
<baseAddresses>
<add baseAddress="https://192.168.1.171:8000/ApplicationServiceModel/service"/>
</baseAddresses>
</host>
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="basicHttp"
contract="Application.ServiceModel.IApplicationService" />
<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange"/>
<endpoint address="http://localhost:8000/"
binding="webHttpBinding"
contract="Application.ServiceModel.IApplicationService"
behaviorConfiguration="webHttpBehavior" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="serviceBehavior">
<serviceMetadata httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="webHttpBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
【问题讨论】:
标签: c# wcf silverlight service