错误信息
无法处理消息。这很可能是因为操作“http://tempuri.org/XXXX/xxx方法”不正确,或因为消息包含无效或过期的安全上下文令牌,或因为绑定之间出现不匹配。如果由于未处于活动状态导致服务中止了该通道,则安全上下文令牌无效。若要防止服务永久中止闲置会话,请增加服务终结点绑定上的接收超时。
在本机测试成功.
放到服务器后出现以上问题.通过http可以访问.
服务器端配置
Code
<system.serviceModel>
<services>
<service behaviorConfiguration="SomeBehavior" name="xxx方法">
<endpoint address="" binding="wsHttpBinding" contract="xxxx.Ixxx">
<identity>
<dns value="远程ip地址"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="SomeBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="bd" closeTimeout="01:00:00" openTimeout="01:00:00" receiveTimeout="01:00:00" sendTimeout="01:00:00" transactionFlow="false" transferMode="Streamed" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288" maxBufferSize="655360" maxConnections="10" maxReceivedMessageSize="655360">
<readerQuotas maxDepth="320" maxStringContentLength="655360" maxArrayLength="163840" maxBytesPerRead="40960" maxNameTableCharCount="163840" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="None">
<transport clientCredentialType="Windows" />
<message clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_IDisService" closeTimeout="01:00:00" openTimeout="01:00:00" receiveTimeout="01:00:00" sendTimeout="01:00:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="655360" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="655360" maxArrayLength="163840" maxBytesPerRead="40960" maxNameTableCharCount="163840" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="None">
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
客户端配置
Code
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_Ixxx" closeTimeout="01:00:00"
openTimeout="01:00:00" receiveTimeout="01:00:00" sendTimeout="01:00:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="5242880" maxReceivedMessageSize="655360"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="655360" maxArrayLength="163840"
maxBytesPerRead="40960" maxNameTableCharCount="163840" />
<reliableSession ordered="true" inactivityTimeout="01:00:00"
enabled="false" />
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://远程ip:端口/xxx方法.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_Ixxx"
contract="ServiceReference.Ixxx" name="WSHttpBinding_Ixxx">
<identity>
<dns value="远程ip" />
</identity>
</endpoint>
</client>
</system.serviceModel>
请高手帮忙看下,谢谢!!