1

WCF は IIS7 にデプロイされ、ネットワーク経由のアクセスと Web サイト (ASP.NET C#) も同じサーバーにデプロイされます。ネットワーク経由で WCF は正常に通信しますが、ローカルホスト サーバーでは WCF は Web サイトと通信しません。私のwcfの設定は

<system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IWITSService" closeTimeout="00:00:05"
                  openTimeout="00:00:05" receiveTimeout="00:10:00" sendTimeout="00:00:05"
                  bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                  maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
                  textEncoding="utf-8" useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                      maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <!--<reliableSession ordered="true" inactivityTimeout="00:10:00" />-->
                    <security mode="Message">
                        <transport clientCredentialType="Windows" proxyCredentialType="None" />


                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:4570/WITSWCFService.svc"
              binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWITSService"
              contract="WITS.IWITSService" name="BasicHttpBinding_IWITSService" >
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>

AND ウェブサイトの構成は以下のとおりです

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding  name="BasicHttpBinding_IWITSService" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferPoolSize="524288">
          <readerQuotas maxDepth="32" maxStringContentLength="2147483647" 
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"  />
        </binding>
      </basicHttpBinding>
      <!--<webHttpBinding>
        <binding maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" />
      </webHttpBinding>-->
    </bindings>
    <services>
      <service name="WITSService.WITSService">
        <clear />
        <endpoint binding="basicHttpBinding" contract="WITSService.WITSService"   />
      </service>
    </services>

    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false"/>

        </behavior>
      </serviceBehaviors>

    </behaviors>


  </system.serviceModel>
4

1 に答える 1

0

localhostまたは でのみ実行されていlocalhost:4570ます。ポートを使用している場合は4570、実サーバーでポートを開く必要があります。

ブラウザーで URL をヒットした場合、WCF エンドポイントは何を返しますか。これは通常、問題を非常によく示しています。

于 2013-01-04T13:35:56.747 に答える