WCF IIS 7
От: vadi  
Дата: 26.04.11 07:31
Оценка:
Создал сервис WCF. Захостил его на IIS.
Через браузер все работает.
Ссылка http://ibp-v.ibpsoft/testWcf2/test.svc?wsdl
Когда в студии VS2010 делаю AddServiceReference (путь http://ibp-v.ibpsoft/testWcf2/test.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://ibp-v.ibpsoft/testWcf2/test.svc?xsd=xsd0'.
— The underlying connection was closed: An unexpected error occurred on a receive.
— Unable to read data from the transport connection: Удаленный хост принудительно разорвал существующее подключение.
— Удаленный хост принудительно разорвал существующее подключение
Metadata contains a reference that cannot be resolved: 'http://ibp-v.ibpsoft/testWcf2/test.svc?wsdl'.
Metadata contains a reference that cannot be resolved: 'http://ibp-v.ibpsoft/testWcf2/test.svc?wsdl'.
If the service is defined in the current solution, try building the solution and adding the service reference again.

Перерыл весь инет так и не понял куда копать.
Если в браузере открыть эту ссылку то там внутри можно увидеть следующие строки:

<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://ibp-v.ibpsoft/testWcf2/test.svc?xsd=xsd0" namespace="http://tempuri.org/"/>
<xsd:import schemaLocation="http://ibp-v.ibpsoft/testWcf2/test.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
<xsd:import schemaLocation="http://ibp-v.ibpsoft/testWcf2/test.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/WcfServiceLibrary1"/>
</xsd:schema>

Видимо он и ругается на этот путь (http://ibp-v.ibpsoft/testWcf2/test.svc?xsd=xsd0). Естественно что его нет.

Вот мой конфиг файл на всякий случай:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="WcfServiceLibrary1.Service1" behaviorConfiguration="MEXServiceTypeBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost/testWcf2/test.svc"/>
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" contract="WcfServiceLibrary1.IService1"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MEXServiceTypeBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>

</configuration>
wcf iis
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.