Session ID in Web Services

Hints, Tips and Tricks

Technical Hints Tips and Tricks that cover customization and development using Sage CRM. API usage and coding are covered.

Session ID in Web Services

  • Comments 2
  • Likes

When accessing Sage CRM via the Web Services API a user session needs to be created.

private WebService WS=new WebService();
private logonresult SID;
SID=WS.logon("wsuser","x3%b0H2");
WS.SessionHeaderValue = new SessionHeader();
WS.SessionHeaderValue.sessionId = SID.sessionid;
//
//do work here
//
WS.logoff(SID.sessionid);

This would return in an on-premise install of CRM a session id that was in the form 92391231117384.

Comments