2013-06-19 47 views
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 
{ 
} 

所以任何人都可以帮助我解决这个问题。

回答

0

从你的web.config文件中删除线

<security mode="Transport"> 

。因为传输似乎需要使用HTTPS来加密凭证。

+0

但我不需要加密凭据,只是我想运行该服务。 – user2431952

+0

so删除这行代码 –

+0

我曾尝试过,没有获利 – user2431952