Україна понад усе! Приєднуйтеся до допомоги!
Вопрос
MS Visual Studio: почему не удается добавить ссылку на Web- сервис? Add Service Reference Error.
18 апреля 2016 13:41
Коллеги, приветствую.
В конфигурации реализован простой веб- сервис, прототип для дальнейших решений, скажем так..
Контракт:
namespace SimpleCustomService
{
[ServiceContract]
public interface UsrIService
{
[OperationContract]
string SayHello(string value);
}
}
{
[ServiceContract]
public interface UsrIService
{
[OperationContract]
string SayHello(string value);
}
}
Реализация:
namespace SimpleCustomService
{
public class UsrService : UsrIService
{
public string SayHello(string value)
{
return "Hello" + value;
}
}
}
{
public class UsrService : UsrIService
{
public string SayHello(string value)
{
return "Hello" + value;
}
}
}
В браузере я могу обратиться к WSDL:
http://localhost:8080/0/ServiceModel/SimpleCustomService.svc?wsdl
Или так:
http://localhost:8080/0/ServiceModel/SimpleCustomService.svc?singleWsdl
Но когда я пытаюсь добавить ссылку в проект MS Visual Studio, получаю ошибку:
По ссылке Details следующее:
The HTML document does not contain Web service discovery information.
Metadata contains a reference that cannot be resolved: 'http://localhost:8080/0/ServiceModel/SimpleCustomService.svc?wsdl'.
The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '
xmlns="http://www.w3.org/1999/xhtml">
> http-equiv="X-UA-Compatible" content="IE=Edge" /> http-equiv="Content-Type" content="text/html; charset=utf-8" />> href="favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" /><span style="color: #000000; font-weight: bold;">>
bpm'online bank customer journey
>
.login-label-logo
{
background: url("terrasoft.axd?s=nui-binary-syssetting&r=Logoimage");
background-repeat: no-repeat;
width: 223px;
height: 100px;
margin-bottom: 28px;
background-position: left bottom;
}
>
Metadata contains a reference that cannot be resolved: 'http://localhost:8080/0/ServiceModel/SimpleCustomService.svc?wsdl'.
The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '
xmlns="http://www.w3.org/1999/xhtml">
> http-equiv="X-UA-Compatible" content="IE=Edge" /> http-equiv="Content-Type" content="text/html; charset=utf-8" />> href="favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
bpm'online bank customer journey
>
.login-label-logo
{
background: url("terrasoft.axd?s=nui-binary-syssetting&r=Logoimage");
background-repeat: no-repeat;
width: 223px;
height: 100px;
margin-bottom: 28px;
background-position: left bottom;
}
>