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: <faultstring>Economic.Api.Exceptions.AuthenticationException(E02250): User is not authenticated. Access denied. {id=xxxxxxxxx}</faultstring><detail />.
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):
<SOAP-ENV:Header>
<Cookie>ASP.NET_SessionId=yyyyyyyyyyy</Cookie>
</SOAP-ENV:Header>
<SOAP-ENV:Header>
<Cookie><ASP.NET_SessionId>mgtpgc55x4apim55f4wdi255</ASP.NET_SessionId></Cookie>
</SOAP-ENV:Header>
<SOAP-ENV:Header>
<ASP.NET_SessionId>mgtpgc55x4apim55f4wdi255</ASP.NET_SessionId>
</SOAP-ENV:Header>

