0
我想啓用(SessionMode = SessionMode.Required)在我的服務,所以,當我已經啓用則使用WCF客戶端測試測試服務也提高了以下錯誤:WCF會話配置錯誤
郵件無法被處理。這很可能是因爲操作'http://schemas.xmlsoap.org/ws/2004/09/transfer/Get'不正確,或者因爲消息包含無效或過期的安全上下文標記或者因爲綁定之間存在不匹配。如果服務由於不活動而中止通道,則安全上下文令牌將無效。爲了防止服務中止空閒會話過早加大對服務端點的binding.HTTP接收超時出現錯誤
URI: http://localhost:7645/PublisherService.svc
的HTML文檔不包含Web服務發現信息。
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="myBasicBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" closeTimeout="00:01:00" openTimeout="00:01:00" sendTimeout="00:01:00" receiveTimeout="00:01:00">
<readerQuotas maxDepth="128" maxStringContentLength="8388608" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="2147483647"/>
</binding>
</basicHttpBinding>
<!--enable WSHTTPBinding session-->
<wsHttpBinding>
<binding name="bindingAction" transactionFlow="false" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" sendTimeout="00:01:00" receiveTimeout="00:01:00" closeTimeout="00:01:00" openTimeout="00:01:00">
<readerQuotas maxDepth="128" maxStringContentLength="8388608" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="2147483647"/>
<reliableSession enabled="true"/>
<security mode="Transport">
<message establishSecurityContext="false" clientCredentialType="IssuedToken"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<protocolMapping>
<add scheme="http" binding="wsHttpBinding"/>
</protocolMapping>
<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\\ -->
<services>
<service name="AllChatService.PublisherService" behaviorConfiguration="metadataSupport">
<host>
<baseAddresses>
<add baseAddress ="http://localhost:7645/"/>
</baseAddresses>
</host>
<endpoint contract="AllChatService.PublisherService" binding="wsHttpBinding" address=""/>
<!--Enable Meta Data Publishing-->
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="metadataSupport">
<serviceDebug includeExceptionDetailInFaults="False" />
<!--Enable WSDL Data Binding-->
<serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
[ServiceBehaviorAttribute(InstanceContextMode = InstanceContextMode.PerCall)]
public class PublisherService : IPublisher
{
}
[ServiceContract(SessionMode = SessionMode.Required)]
public interface IPublisher
{
}
所以任何人都可以幫助我解決這個問題。
但我不需要加密憑據,只是我想運行該服務。 – user2431952
so刪除這行代碼 –
我曾嘗試過,沒有獲利 – user2431952