| Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате |
| Форум программистов > Распределённые приложения и сеть > Проблема с вызовом веб-сервиса (WCF) |
| Автор: nginx 20.6.2009, 21:57 |
| Добрый вечер, У меня возникла след. проблема. {"Could not find default endpoint element that references contract 'IService1' 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."} Я создал WCF сервис, прогнал след команду в cmd: svcutil.exe http://localhost:51797/Service1.svc?wsdl Дальше я добавил полученные *.CS и *.config, в свой другой WinForms проект. В WinForms добавил label и button + естественно Service References добавил: private void button1_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; Service1Client client = new Service1Client(); client.Close(); label1.Text = "Service Works!"; } Судя по тексту ошибки "...This might be because no configuration file was found for your application..." Жалуется, что нет *.config файла, который я создал (после svcutil.exe http://localhost:51797/Service1.svc?wsdl), Как ни странно, но в проекте *.config файл присутсвует =( |
| Автор: mihryak 30.6.2009, 18:22 |
| если актуально ещё - приведи сервисный и клиентский конфиги, а также ServiceContract |