ServiceReference未在IIS 7中更新

时间:2010-08-09 09:03:26

标签: c# wcf iis iis-7

在服务器上我有web.config到我的应用程序:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>

  </appSettings>
  <connectionStrings>

  </connectionStrings>

  <system.serviceModel>
  <bindings>
    <basicHttpBinding>
        <binding name="BasicHttpBinding_IService" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="2097152000" maxBufferPoolSize="524288000" maxReceivedMessageSize="2097152000"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="524288000"
            maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
  </bindings>
  <services>
    <service name="Server.FileServer.Service" behaviorConfiguration="Server.FileServer.Service1Behavior">
      <host>
        <baseAddresses>
          <add baseAddress="http://192.168.1.217/FileServer/" />
        </baseAddresses>
      </host>
      <!-- Service Endpoints -->
      <!-- Unless fully qualified, address is relative to base address supplied above -->
      <endpoint address="" contract="Server.FileServer.IService" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService">
        <!-- 
              Upon deployment, the following identity element should be removed or replaced to reflect the 
              identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
              automatically.
          -->
        <identity>
          <dns value="localhost" />
        </identity>
      </endpoint>
      <!-- Metadata Endpoints -->
      <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. -->
      <!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="Server.FileServer.Service1Behavior">
        <!-- To avoid disclosing metadata information, 
          set the value below to false and remove the metadata endpoint above before deployment -->
        <serviceMetadata httpGetEnabled="True" />
        <!-- To receive exception details in faults for debugging purposes, 
          set the value below to true.  Set to false before deployment 
          to avoid disclosing exception information -->
        <serviceDebug includeExceptionDetailInFaults="true" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
  </system.serviceModel>
  <system.web>
    <compilation debug="true" />
    <httpRuntime maxRequestLength="2097151" executionTimeout="1000" />
       <customErrors mode="RemoteOnly" />
  </system.web>
    <system.webServer>
        <directoryBrowse enabled="true" />
    </system.webServer>
</configuration>

但是当我通过wcf测试客户端检查时,我有:

xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IService" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://SOMEADRESS.pl/FileServer/Server.FileServer.Service.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
                contract="IService" name="BasicHttpBinding_IService" />
        </client>
    </system.serviceModel>
</configuration>

正如您所看到的绑定参数不一样

有什么想法吗?

2 个答案:

答案 0 :(得分:2)

创建服务引用时,绑定参数(如缓冲区大小)不会自动从服务器传播到客户端。您还必须在客户端手动调整下摆。

那是个问题吗?对我来说有点不清楚问题究竟是什么。

答案 1 :(得分:1)

我认为Thorarin是对的,有些信息无法从服务器传播到客户端。 在这里结帐http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/dde72fbe-e741-48fd-a9e1-253800d5227a