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

Creating the session

0
Hi, I'm trying to use the SOAP services for pulling out data with C#.

I keep getting an AuthenticationException, I'm just not sure how to set up the connection state properly.

The tutorial has an example with an EconomicWebServiceLocator and a setMaintainSession(), but the Locator class doesn't exist as far as I can tell, it's not part of the WSDL.

I've tried a bunch of things, my best guess so far has been something like this which seems somewhat logical to me:

            var proxy = new EconomicWebServiceSoapClient();
            var response = proxy.Connect(agreementNumber: ..., userName: ..., password: ...);
            var handles = proxy.Order_FindByDateInterval(DateTime.Now.AddYears(-20), DateTime.Now);
            ....
            proxy.Disconnect();

Connect() does return a token in the response, but after that I still get an AuthenticationException on the next Order_FindByDateInterval().
Is Connect() not enough here, or is this somehow a privilege issue on the server side?
When using the API it seems to work okay though but no luck with the SOAP service, so I figure it must be an issue with the connection state itself.

regards, Sune
created May 7, 2012 by SuneF
0% Accept Rate
Q 1 A 1 C 0

4 Answers

0
Hi Sune,

If you're using C# anyway, you can utilize the assembly we provide for wrapping the web services.

You can pick it up as part of our full SDK here: http//wwwe-conomiccouk/apps/app-partner.


Best regards,
answered May 7, 2012 by Christian Estrup
0


Hi Christian

The assembly appears to be working fine, but I'm doing system integration as part of a student project and using the assembly feels like cheating

Using SOAP should be equivalent I think while having a slightly lower coupling and better portability, so that would be my option of choice if I could figure out how to establish the connection state.
Any hints?
answered May 7, 2012 by SuneF
0
The .Net API is VERY slow to connect, would it be possible to use SOAP calls instead? Can you do the same with this, and is this faster to connect?
answered May 30, 2012 by Jacob_2500
0
Try this:

var ws = new ServiceReference1EconomicWebServiceSoapClient();
((BasicHttpBinding)wsEndpointBinding)AllowCookies = true;
answered Dec 6, 2012 by javid
Visma e-conomic A/S
...