API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

Could not find default endpoint element that references contract in the ServiceModel client configuration section

0

Hi, I have a ASP .NET MVC app that I want to be able to connect to SOAP api. 

I have created a wrapper project were I have my common methods that are working with the API and there is the wsdl file too. I have referenced this as dll in my class library (middle layer) that is referenced into my MVC application.

Sadly it is not working, and I am getting this error:

Could not find default endpoint element that references contract 'S2s.Economic.WebService.EconomicWebServiceSoap' 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.

I have tried to setup the endpoint in webconfig file with no success.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 
<system.web>
       .....
</system.web>
 
<runtime>
...
</runtime>
 
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="EconomicWebServiceSoap">
<security mode="Transport" />
</binding>
<binding name="EconomicWebServiceSoap1" />
</basicHttpBinding>
</bindings>
<client>
                binding="basicHttpBinding" bindingConfiguration="EconomicWebServiceSoap"
                contract="PTS.S2s.Economic.WebService.EconomicWebServiceSoap"
                name="EconomicWebServiceSoap" />
</client>
</system.serviceModel>
</configuration>
A will apreciate any help.
created Apr 3, 2016 by PetrZdarsky
50% Accept Rate
Q 4 A 1 C 2

2 Answers

0
 
Best answer
I have managed to find a workarround with manual endpoint setup in the code.
EndpointAddress  endpoint = new EndpointAddress( "https://api.e-conomic.com/secure/api1/economicwebservice.asmx" );
answered Apr 8, 2016 by PetrZdarsky
0
Hi Petr

Perhaps take a closer look at the contract in the endpoint setting. That might be the problem.
If you haven't yet, then please take a look at https://www.e-conomic.com/developer/creating-an-api-web-service-library and see if that helps.
answered Apr 4, 2016 by olej
Visma e-conomic A/S
...