Создал сервис 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>
Здравствуйте, vadi, Вы писали:
V><?xml version="1.0" encoding="utf-8" ?>
V><configuration>
V> <system.serviceModel>
V> <services>
V> <service name="WcfServiceLibrary1.Service1" behaviorConfiguration="MEXServiceTypeBehavior">
V> <host>
V> <baseAddresses>
V> <add baseAddress="http://localhost/testWcf2/test.svc"/>
V> </baseAddresses>
V> </host>
V> <endpoint address="" binding="wsHttpBinding" contract="WcfServiceLibrary1.IService1"/>
V> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
V> </service>
V> </services>
V> <behaviors>
V> <serviceBehaviors>
V> <behavior name="MEXServiceTypeBehavior">
V> <serviceMetadata httpGetEnabled="true" />
V> <serviceDebug includeExceptionDetailInFaults="false"/>
V> </behavior>
V> </serviceBehaviors>
V> </behaviors>
V> </system.serviceModel>
V></configuration>
попробуй так
<behavior name="MEXServiceTypeBehavior"> -> <behavior name="">
<service name="WcfServiceLibrary1.Service1" behaviorConfiguration="MEXServiceTypeBehavior"> -> <service name="WcfServiceLibrary1.Service1" >
... << RSDN@Home 1.2.0 alpha 5 rev. 1497>>
Здравствуйте, Holms, Вы писали:
Тот же результат

...
Здравствуйте, vadi, Вы писали:
V>Создал сервис WCF. Захостил его на IIS.
V>Через браузер все работает.
V>Ссылка http://ibp-v.ibpsoft/testWcf2/test.svc?wsdl
V>Когда в студии VS2010 делаю AddServiceReference (путь http://ibp-v.ibpsoft/testWcf2/test.svc?wsdl)
V>то пишет ошибку:
а если добавлять по ссылке
http://ibp-v.ibpsoft/testWcf2/test.svc без постфикса ?wsdl
Дополнительная информация:
В самом низу описания ошибки есть строки:
Metadata contains a reference that cannot be resolved: '
http://localhost/testWcf2/test.svc?wsdl'.
Content Type application/soap+xml; charset=utf-8 was not supported by service
http://localhost/testWcf2/test.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.
Может это как-то прояснит ситуацию.
Видно что ругается на content type...
Здравствуйте, vadi, Вы писали:
V>Создал сервис WCF. Захостил его на IIS.
V>Через браузер все работает.
V>Ссылка http://ibp-v.ibpsoft/testWcf2/test.svc?wsdl
V>Когда в студии VS2010 делаю AddServiceReference (путь http://ibp-v.ibpsoft/testWcf2/test.svc?wsdl)
V>то пишет ошибку:
что-то подобное было когда WCF не был зарегистрирован, попробуйте:
%systemroot%\Microsoft.NET\Framework\v4.0.30319\ServiceModelReg.exe –i
К сожалению тоже самое .....
A>Здравствуйте, vadi, Вы писали:
V>>Создал сервис WCF. Захостил его на IIS.
V>>Через браузер все работает.
V>>Ссылка http://ibp-v.ibpsoft/testWcf2/test.svc?wsdl
V>>Когда в студии VS2010 делаю AddServiceReference (путь http://ibp-v.ibpsoft/testWcf2/test.svc?wsdl)
V>>то пишет ошибку:
A>что-то подобное было когда WCF не был зарегистрирован, попробуйте:
A>A>%systemroot%\Microsoft.NET\Framework\v4.0.30319\ServiceModelReg.exe –i
A>