Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > .NET Frameworks (точка нет фреймворки) > C# (си шарп)
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 07.11.2016, 11:05   #1
Slagam
Новичок
Джуниор
 
Регистрация: 07.11.2016
Сообщений: 1
По умолчанию ExceptionSystem.InvalidOperationExc eption WSDL через DLL

Реализовываю шлюз на WSDL и столкнулся с проблемой.
Так как при добавлении сервиса к проекту в VS2015 создается файл app.config с параметрами конечной точки, то когда в dll*происходит*инициализация класса*WSDL вылетает ошибка:
Цитата:
17:39:11 : errol System.InvalidOperationException: Could not find default endpoint element that references contract 'Internet.IServicePayment' 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.
at System.ServiceModel.Description.Con figLoader.LoadChannelBehaviors(Serv iceEndpoint serviceEndpoint, String configurationName)
at System.ServiceModel.ChannelFactory. ApplyConfiguration(String configurationName)
at System.ServiceModel.ChannelFactory. InitializeEndpoint(String configurationName, EndpointAddress address)
at System.ServiceModel.ChannelFactory` 1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)
at System.ServiceModel.EndpointTrait`1 .CreateSimplexFactory()
at System.ServiceModel.EndpointTrait`1 .CreateChannelFactory()
at System.ServiceModel.ClientBase`1.Cr eateChannelFactoryRef(EndpointTrait `1 endpointTrait)
at System.ServiceModel.ClientBase`1.In itializeChannelFactoryRef()
at System.ServiceModel.ClientBase`1..c tor()
at FirstGateway.Internet.ServicePaymen tClient..ctor()
at FirstGateway.GatewayCore.CheckAccou nt(Context& context)
но в самом конфиге он присутствует:

Код:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IServicePayment">
                    <security mode="TransportWithMessageCredential" />
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="***"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IServicePayment"
                contract="Internet.IServicePayment" name="BasicHttpBinding_IServicePayment" />
        </client>
    </system.serviceModel>
</configuration>
вылетает как я понимаю, потому что в зоне видимости нет этот самого файла app.config. вот и вопрос как вшить конфиг в dll-ку, или настроить*жесткий путь к файлу,*или чтоб при обращении за настройками обращался к внутренней строке на XML.

Последний раз редактировалось Alex11223; 07.11.2016 в 11:19.
Slagam вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Проблема с wsdl php-coder PHP 0 14.09.2015 16:58
Плагины через dll Lime Общие вопросы Delphi 7 17.06.2010 20:50
из Matlab'a в Delphi через dll Mikhail Bakurov Общие вопросы Delphi 7 03.12.2009 14:25
DLL через Lib kiloruble Общие вопросы C/C++ 1 02.12.2008 22:58
soap wsdl nimf Общие вопросы Delphi 0 22.08.2008 16:10