powered by simpleCommunicator - 2.0.40     © 2025 Programmizd 02
Форумы / WCF, Web Services, Remoting [игнор отключен] [закрыт для гостей] / Could not find default endpoint element that references contract ...
1 сообщений из 1, страница 1 из 1
Could not find default endpoint element that references contract ...
    #39604742
AlexV1
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Добрый день!

В Windows Forms Application на C# необходимо подключиться к некому стороннему (чужому) SOAP сервису
http://isms.center/soap
и вызвать один из его методов.

Делаю так:

В Solution Explorer у проекта по правой кнопке мыши на Service References выбираю "Add Service Reference",
указываю в появившемся диалоге http://isms.center/soap, жму "GO" - все нормально, сервис виден, методы видны, называю Namespace "ServiceReference1", жму OK.

ServiceReference1.SendSMSService service = new ServiceReference1.SendSMSServiceClient();
SendMessageRequest r = new SendMessageRequest(Login, Password, sms_kaz);
SendMessageResponse res = service.SendMessage(r);

и вот тут выдает:

Could not find default endpoint element that references contract 'ServiceReference1.SendSMSService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

app.config проекта таков:

<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>

<system.serviceModel>
...
<bindings>
<basicHttpBinding>
<binding name="SendSMSServiceBinding" />
</basicHttpBinding>
...
</bindings>

<client>
...
<endpoint address=" http://isms.center/ru/soap/server" binding="basicHttpBinding"
bindingConfiguration="SendSMSServiceBinding" contract="ServiceReference1.SendSMSService"
name="SendSMSServicePort" />
</client>

</system.serviceModel>
</configuration>

Пробовал удалить из этого конфига строку "<endpoint address=" http://isms.center/ru/soap/server ... " ... />
Ничего не меняется, из чего делаю вывод, что программа просто не видит прописанный автоматом endpoint.
Но почему? Может contract странно указан?
...
Рейтинг: 0 / 0
1 сообщений из 1, страница 1 из 1
Форумы / WCF, Web Services, Remoting [игнор отключен] [закрыт для гостей] / Could not find default endpoint element that references contract ...
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]