Конфигурация сервера WCF IIS - PullRequest
2 голосов
/ 13 июля 2011

У меня Windows Server 2008 R2 с IIS7 на нем. Я развернул на нем сервис WCF. Когда я указываю адрес службы WCF в браузере (локальный или внешний компьютер) http://sbkisourcedev01/VCIndex/Calculator.svc?wsdl, я получаю описание службы в браузере. Однако, когда я пытаюсь добавить ссылку на проект в эту службу, я получаю следующую ошибку:

The document was understood, but it could not be processed.  

  - The WSDL document contains links that could not be resolved.
  - There was an error downloading 'http://sbkisourcedev01/VCIndex/Calculator.svc?xsd=xsd0'.
  - The underlying connection was closed: An unexpected error occurred on a receive.
  - Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
  - An existing connection was forcibly closed by the remote host

Metadata contains a reference that cannot be resolved: 'http://sbkisourcedev01/VCIndex/Calculator.svc?wsdl'.
Content Type application/soap+xml; charset=utf-8 was not supported by service http://sbkisourcedev01/VCIndex/Calculator.svc?wsdl.  The client and service bindings may be mismatched.
The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..
If the service is defined in the current solution, try building the solution and adding the service reference again.

У меня эта служба работает на Windows 7, и все в порядке. Поэтому я считаю, что что-то с настройками конфигурации моего W2K8 IIS.

Вот мой конфигурационный файл:

  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="basicHttpBindingConfig" />
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="serviceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    <services>
      <service behaviorConfiguration="serviceBehavior"
               name="WCFVCIndex.Calculator">
        <endpoint address=""
                  binding="basicHttpBinding"
                  contract="WCFVCIndex.ICalculator"
                  bindingConfiguration="basicHttpBindingConfig" />
        <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" />
      </service>
    </services>
  </system.serviceModel>

Заранее спасибо.

Ответы [ 2 ]

7 голосов
/ 13 июля 2011

Проблема была с разрешениями идентификации WCF.Идентификатор, используемый для пула приложений, в котором размещается служба WCF, должен иметь полные разрешения NTFS для папки% WINDIR% \ temp.После изменения этого разрешения на мою личность (LOCAL SERVICE) на C: \ Windows \ Temp я смог добавить ссылку на службу в службу WCF.

1 голос
/ 13 июля 2011

вы пробовали http://sbkisourcedev01/VCIndex/mex?

...