На главную Наши проекты:
Журнал   ·   Discuz!ML   ·   Wiki   ·   DRKB   ·   Помощь проекту
ПРАВИЛА FAQ Помощь Участники Календарь Избранное RSS
msm.ru
  
> Прокси для веб сервиса , VS 2008(3.5)
    Привет всем.
    Замучила одна проблема. Суть такова.
    У меня есть солюшн. В нем есть два проекта, которые должны юзать вебсервис. Для этого я создал еще проект Class Library, в который добавил вебреференс на сервис. Таким образом студия сгенерила прокси. В этом проекте(Class Library) я создал класс - наследник сгенеренного класса ServiceSoapClient:
    ExpandedWrap disabled
      namespace AppClient
      {
          public class MyService : AppClient.Services.ServiceSoapClient
          {
              public MyService(string s) : base(s) {}
          }
      }

    Потом создаю экземпляр этого класса
    ExpandedWrap disabled
      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:
    ExpandedWrap disabled
      <?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>


    Что я делаю не так? Подскажите, пожалуйста
    Сообщение отредактировано: YaNGol -
      может, "no configuration file was found for your application"?
      0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)
      0 пользователей:


      Рейтинг@Mail.ru
      [ Script execution time: 0,0623 ]   [ 16 queries used ]   [ Generated: 7.05.24, 19:31 GMT ]