DestroySession
- Method
SlimCD.Sessions.DestroySessions
Purpose
Destroy and delete a session.
Description
- username
- password
- sessionid
Business Rules
Argument List
Name Required Usage DestroySessionRequest Required Object containing properties for the request timeout Optional Integer wait time, in seconds, before timeout response is generated callback* Optional Function to call upon completion of asynchronous request *for JavaScript only
DestroySession Request Fields
Field Name Type Length Required Description UserName string 20 require Username or API Access Credential that accesses web service. Password string 20 require Plaintext password for the client account. SessionID string 40 require HEX string uniquely representing the session 1. Passwords are required except when the username is set to an API Access Credential, in which case it should be passed in as an empty string..
Reply Fields
reply outer tag for the reply data block response Success, FAIL, Error response code 0, 1, 2 (respective) matching the above description If successful, this will contain the single word, OK. Otherwise it will contain a description of failure or error which occurred reponseurl The Slimcd.com url which was called for this operation datablock The confirmation text returned from the server. Reply Hierarchy
- reply
- response
- responsecode
- description
- responseurl
- datablock
Remarks
- General
- Names in name/value pairs are NOT case-sensitive
- Names inside XML tags ARE case-sensitive
- Function-Specific
- None
- Include
012<script src="https://trans.slimcd.com/soft/json/slimcd.js"></script>
Method
12345function DestroySession(request,callback)function DestroySession(request,timeout,callback)
Request
1234567request= {"username": "1032","password": "289075","sessionid": "85F9FA841DDB173B10AD35E0B9EA097E9CC68321"}
Reply
1234567891011callback ( {"reply":{"response": "Success","responsecode": "0","description": "OK","responseurl": "/soft/DestroySession.asp","datablock": null}} );
Sample Code
123456789101112131415161718<script src="https://trans.slimcd.com/soft/json/slimcd.js"></script><script>// <![CDATA[SlimCD.Sessions.DestroySession({"username": "1032","password": "289075","sessionid": "6B9AC5C22EF62BB46EDBC2D2C49215D1157E3439",},function (reply) {if (reply.response == "Success") {alert ('Batch Closed');} else {alert('There was a problem closing the batch:\r\n' + reply.description);}});// ]]></script>
Downloads - Include
012include 'slimcd.php';
Method
123function Sessions_DestroySessions (Sessions_DestroySessionsRequest $request,$timeout=false)Request
12345678910class Sessions_DestroySessionsRequest{// property declarationpublic $username = '';public $password = '';public $sessionid="";}JSON Reply
123456789{"response": "Success","responsecode": "0","description": "OK","responseurl": "/soft/DestroySession.asp","datablock": null}Sample Code
12345678910111213141516171819include 'slimcd.php';// Create the Slim CD object$SlimCD = new SlimCD() ;// Create a DestroySession Request class$request = new Sessions_DestroySessionsRequest() ;$request->username = '1032';$request->password = '289075';$request->sessionid = "4C2A7F35504D2466CAB2D35A4A270735A49F4708";$result = $SlimCD->Sessions_DestroySessions($request);if ($result->response == 'Success') {echo 'Success!' ;}else {echo $result->response . ':' . $result->description ;}Downloads Download full sample source.
- Include
123using SlimCD;
Method
123public DestroySessionReply DestroySession(DestroySessionRequest request, int timeout);
Request
12345678public class DestroySessionRequest{public string username { get; set; }public string password { get; set; }public string sessionid { get; set; }}
Reply
123456789101112public class DestroySessionReply{public string response;public string responsecode;public string description;public string responseurl;public string datablock;public string senddata;public string recvdata;}
Cross Reference:ClientSample Code
1234567891011121314151617SlimCD.Sessions sessions = new SlimCD.Sessions();DestroySessionRequest request = new DestroySessionRequest();DestroySessionReply reply = new DestroySessionReply();request.username = 1032;request.password = 289075;request.sessionid ="BCCE198856FD39E18BC00B70FCFEDA693D3A4FD9";reply = sessions.DestroySession(request, 60);if (reply.response.ToUpper() == "SUCCESS"){MessageBox.Show("Success");}else{MessageBox.Show("There was a problem:\n(" + reply.response & ") " + reply.description);}Downloads Download full sample source.
- Include
123using SlimCD;
Method
0123public async Task DestroySession(DestroySessionRequest request,int timeout);
Request
12345678public class DestroySessionRequest{public string username { get; set; }public string password { get; set; }public string sessionid { get; set; }}
Reply
123456789101112public class DestroySessionReply{public string response;public string responsecode;public string description;public string responseurl;public string datablock;public string senddata;public string recvdata;}
Cross Reference: ClientSample Code
1234567891011121314151617SlimCD.Sessions sessions = new SlimCD.Sessions();DestroySessionRequest request = new DestroySessionRequest();DestroySessionReply reply = new DestroySessionReply();request.username = 1032;request.password = 289075;request.sessionid ="BCCE198856FD39E18BC00B70FCFEDA693D3A4FD9";reply = await sessions.DestroySession(request, 60);if (reply.response.ToUpper() == "SUCCESS"){MessageBox.Show("Success");}else{MessageBox.Show("There was a problem:\n(" + reply.response & ") " + reply.description);}Downloads Download full sample source.
- Include
012#import "SlimCD.h"
Method
1234567typedef void (^SessionsDestroySessionReplyBlock)(SessionsDestroySessionReply *reply);- (void) sessionsDestroySessionWithRequest:(SessionsDestroySessionRequest*)request replyBlock:(SessionsDestroySessionReplyBlock)replyBlock;- (void) sessionsDestroySessionWithRequest:(SessionsDestroySessionRequest*)request timeout:(NSTimeInterval)timeout replyBlock:(SessionsDestroySessionReplyBlock)replyBlock;Request
12345678910@interface SessionsDestroySessionRequest@property (strong) NSString *userName;@property (strong) NSString *password;@property (strong) NSNumber *clientID;@property (strong) NSString *sessionID;@endReply
12345@interface SessionsDestroySessionReply : SlimCDReply@endSample Code
123456789101112131415161718192021Â SlimCD *api = [[SlimCD alloc] init];SessionsDestroySessionRequest *request = [[SessionsDestroySessionRequest alloc] init];request.userName = @"1032";request.password = @"289075";request.clientID = @1032;request.sessionID = @"12345";[api sessionsDestroySessionWithRequest:request replyBlock:^(SessionsDestroySessionReply *reply ){if ( reply.responseCode == RC_SUCCESS ){NSLog(@"Session destroyed successfully.");}else{NSLog(@"Unable to destroy session.");}}]; - Method
1234567public void getDestroySession(DestroySessionRequest sessionDestroyRequest,int timeout ,DestroySessionCallback callback)public void getDestroySession(DestroySessionRequest sessionDestroyRequest,DestroySessionCallback callback)
Request
12345678910111213141516171819202122232425262728293031323334353637383940414243public class DestroySessionRequest {// request parameters.private String username;private String password;private String sessionid;public DestroySessionRequest(){username="";password="";sessionid="";}// setters and getters.public String getUsername() {return username;}public void setUsername(String username) {this.username = username;}public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}public String getSessionid() {return sessionid;}public void setSessionid(String sessionid) {this.sessionid = sessionid;}}
Reply
123456789101112131415public class DestroySessionReply {private String datablock="";// setter and getters.public String getDatablock() {return datablock;}public void setDatablock(String datablock) {this.datablock = datablock;}}
Sample Code
12345678910111213141516171819202122232425// Set the request parameter.DestroySessionRequest request=new DestroySessionRequest();request.setUsername("1032");request.setPassword("289075");request.setSessionid("B0625D4FF1783B493AF0D67F8F8777F55A50B49D");new SessionDestroySession().getDestroySession(request,new DestroySessionCallback(){@Overridepublic void getDestroySessionReply(DestroySessionReply reply){if (reply.getResponse().equals("Success"))textBox.setText("Success");elsetextBox.setText("There was a problem:\n" + reply.getResponse() +"\n Descriptin "+ reply.getDescription());}});
Downloads Download full sample source. - URL
Protocols
- SOAP/XML
- HTTP POST
- HTTP GET
Request
Status Codes
Status Code Status Description Explanation 200 200 OK Approved or declined attempts will return a response with an XML reply block 500 500 Internal Server Error The response will not contain XML, as a server error has occurred. Reply Output is in XML format if a status code of 200 is returned.
1234567891011<!--?xml version="1.0" encoding="utf-8" ?--><!--?xml version="1.0" encoding="utf-8" ?-->Success0OK/soft/destroysession.aspAF61FC3FDEF3F2855B599598CD3A11FA485AFC49If the block’s tag does not indicate “Success”, the tag will contain an error description which can be displayed to the end-user
Sample Code
SIMPLE HTML FORM TO SHOW DestroySESSION
Remarks
- Remarks Go here
- URL
123https://stats.slimcd.com/soft/json/jsonscript.asp?service=DestroySession
Protocols- HTTP POST
- HTTP GET
This function accepts either name/value pairs or JSON
Request
Reply
1234567891011{"reply": {"response": "Success","responsecode": "0","description": "OK","responseurl": "/soft/DestroySession.asp","datablock": null}}Sample Code
Remarks
- None