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

SOAP cookie header

I am currently trying to access the WSDL SOAP services using Google Apps Script SOAP to extract time registrations.

The API module is registered (and enabled) and the user I use to connect with has full access (bookkeeping, invoice etc.)

I can run the SOAP Connect function fine and I get the token back, but any further soap requests fail with the exception: faultstringEconomic.Api.Exceptions.AuthenticationException(E02250): User is not authenticated. Access denied. {id=xxxxxxxxx}/faultstringdetail /.

I've tried debugging this using the PHP SOAP client library which works fine and inspecting the HTTP headers I can see that there is a Cookie header. I suspect the authentication exception is generated because it needs to be explicitly set when using Google SOAP (as opposed to PHP SOAP) and thus it is missing.

Full HTTP headers info:
Host: www.e-conomic.com
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.2.6-1+lenny9
Content-Type: text/xml; charset=utf-8
SOAPAction: http://e-conomic.com/Debtor_GetAll
Content-Length: 222
Cookie: ASP.NET_SessionId=yyyyyyyyyyy;

As far as I am aware it is not possible to send HTTP headers with Google SOAP - it is, however, possible to send SOAP headers in the request. Unfortunately I have not been able to get this to work...

So my first question is: Is it even possible to use the SOAP headers to send the ASP.NET_SessionId cookie?

If yes, what is the proper XML syntax of the header? I've tried (and failed) with the following syntaxes so far):



created Nov 9, 2010 by Woodgnome
0% Accept Rate
Q 1 A 0 C 0

2 Answers

I have the same problem. Error E02250.

The Connect method returns an encrypted string.

I dont use a precompiled stub, but the native SOAP methods in Google Apps, so I presume the header must be set up manually.

Can anyone tell what information must be sent in the SOAP header?
answered Dec 17, 2010 by pederb
Google Apps Script does not support HTTP cookies in the builtin SOAP methods.
The e-conomic API relies on ASP.NET session cookie so it is not possible to use these methods.

Googles more native UrlFetch methods could be used, but that is not an easy task.

I hope in the near future there will be a stateless REST implementation of the e-conomics API  
answered Jan 12, 2011 by pederb
Visma e-conomic A/S