Наши проекты:
Журнал · Discuz!ML · Wiki · DRKB · Помощь проекту |
||
ПРАВИЛА | FAQ | Помощь | Поиск | Участники | Календарь | Избранное | RSS |
[13.58.182.39] |
|
Сообщ.
#1
,
|
|
|
Привет всем.
Замучила одна проблема. Суть такова. У меня есть солюшн. В нем есть два проекта, которые должны юзать вебсервис. Для этого я создал еще проект Class Library, в который добавил вебреференс на сервис. Таким образом студия сгенерила прокси. В этом проекте(Class Library) я создал класс - наследник сгенеренного класса ServiceSoapClient: namespace AppClient { public class MyService : AppClient.Services.ServiceSoapClient { public MyService(string s) : base(s) {} } } Потом создаю экземпляр этого класса MyService service = new MyService("ServiceSoap"); Цитата Could not find endpoint element with name 'ServiceSoap' and contract 'Services.ServiceSoap' 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 name could be found in the client element. В проекте Class Library сгенерился app.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="ServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <security mode="None"> <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://localhost:2883/MyServer/Service.asmx" binding="basicHttpBinding" bindingConfiguration="ServiceSoap" contract="Services.ServiceSoap" name="ServiceSoap" /> </client> </system.serviceModel> </configuration> Что я делаю не так? Подскажите, пожалуйста |
Сообщ.
#2
,
|
|
|
может, "no configuration file was found for your application"?
|