注册 登录
编程论坛 WCF论坛

新人求教,WCF 从另一方收到未进行安全处理或安全处理不正确的错误。

x183435739 发布于 2015-02-06 14:35, 5905 次点击
只有本站会员才能查看附件,请 登录

Server端配置
程序代码:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.web>
    <compilation debug="true" />
  </system.web>
  <appSettings>
    <add key="BufferSize" value="4096" />
    <add key="ConStringEncrypt" value="false" />
    <add key="ConnectionString" value="Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.2)(PORT = 1521))(CONNECT_DATA =(SERVICE_NAME = ORCL)));uid=reliableanalysis;pwd=reliableanalysis;" />
  </appSettings>
  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
          <binding name="WS_BlogBinding" closeTimeout="00:10:00" openTimeout="00:10:00"
              receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false"
              maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
              useDefaultWebProxy="true" allowCookies="false">
              <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
    maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00"
                  enabled="false" />
              <security mode="Message">
                  <transport clientCredentialType="Windows" proxyCredentialType="None"
                      realm="" />
                  <message clientCredentialType="Windows" negotiateServiceCredential="true"
                      algorithmSuite="Default" />
              </security>
          </binding>
      </wsHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="Com.PT.Server.Services.UserService" name="Com.PT.Server.Services.UserService">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="WS_BlogBinding" contract="Com.PT.Server.Services">
          <identity>
            <dns value="TestCert" />
          </identity>
        </endpoint>
        <endpoint address="" binding="wsHttpBinding" contract="IMetadataExchange" bindingConfiguration="WS_BlogBinding" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="http://127.0.0.1:8080/bindData/USER">
            <serviceMetadata httpGetEnabled="true" />
            <serviceDebug includeExceptionDetailInFaults="false" />
            <serviceThrottling maxConcurrentCalls="10000" maxConcurrentInstances="10000" maxConcurrentSessions="10000"/>
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>


Client端配置
程序代码:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="WS_BlogBinding" closeTimeout="00:10:00" openTimeout="00:10:00"
                    receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false"
                    maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
                    useDefaultWebProxy="true" allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
    maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Message">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            algorithmSuite="Default" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://127.0.0.1:8080/bindData/USER" binding="wsHttpBinding"
                bindingConfiguration="WS_BlogBinding" contract="SR_Server.KKXFX_Blog"
                name="WSHttpBinding_KKXFX_Blog" />
        </client>
    </system.serviceModel>
</configuration>
3 回复
#2
x1834357392015-02-06 14:38
Help Help ,弄了好久都没解决的问题,求帮助啊。
#3
jhxxy2015-04-24 08:05
阿拉也是菜鸟,看看是否可以学习一下,高手快出手
#4
wangnannan2015-06-04 13:51
endpoit 没有添加bindingconfigration
导致的超时设置没有生效
1