Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
+1
person also asked this
people also asked this
Replies
2 replies
Answers
1 answer
Subscribers
8 subscribers
Views
2203 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
hi, I need a session id for the current session. I
ankitb0003
Certified Lead Developer
over 11 years ago
hi,
I need a session id for the current session.
I have tried API but it is giving me null error.
forum.appian.com/.../6621
have any one tried this before.
Thanks
Ankit ...
OriginalPostID-79680
OriginalPostID-79680
Discussion posts and replies are publicly visible
Parents
+1
ankitb0003
Certified Lead Developer
over 11 years ago
i have included WebServiceContent i am getting following error.18:53:46,233 INFO [stdout] (default-short-running-threads-threads - 49) com.appiancorp.suiteapi.common.exceptions.AppianException: Unable to match input for class class com.appiancorp.services.WebServiceContext
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import com.appiancorp.suiteapi.common.Name;
import com.appiancorp.suiteapi.content.ContentService;
import com.appiancorp.suiteapi.process.exceptions.SmartServiceException;
import com.appiancorp.suiteapi.process.framework.AppianSmartService;
import com.appiancorp.suiteapi.process.framework.Input;
import com.appiancorp.suiteapi.process.framework.MessageContainer;
import com.appiancorp.suiteapi.process.framework.Required;
import com.appiancorp.suiteapi.process.framework.SmartServiceContext;
import com.appiancorp.services.*;
import javax.servlet.http.HttpSession;
import com.appiancorp.suiteapi.process.palette.PaletteInfo;
@PaletteInfo(paletteCategory = "Integration Services", palette = "Connectivity Services")
public class getSessionIdSS extends AppianSmartService {
private static final Logger LOG = Logger.getLogger(getSessionIdSS.class);
private final SmartServiceContext smartServiceCtx;
private String param0;
private String param1;
private String sessionID;
private String return1;
private WebServiceContext webServiceContext;
//private ASLIdentity aSLIdentity;
private ContentService _cs;
private HttpSession httpSession;
@Override
public void run() throws SmartServiceException {
httpSession=(HttpSession)webServiceContext.getSession();
System.out.println(httpSession.getId());
sessionID=httpSession.getId();
}
public getSessionIdSS(SmartServiceContext smartServiceCtx, ContentService _cs, WebServiceContext webServiceContext) {
super();
this.smartServiceCtx = smartServiceCtx;
this._cs=_cs;
this.webServiceContext=webServiceContext;
}
public void onSave(MessageContainer messages) {
}
public void validate(MessageContainer messages) {
}
@Input(required = Required.OPTIONAL)
@Name("param0")
public void setParam0(String val) {
this.param0 = val;
}
@Input(required = Required.OPTIONAL)
@Name("param1")
public void setParam1(String val) {
this.param1 = val;
}
@Name("SessionID")
public String getSessionID() {
return sessionID;
}
@Name("return1")
public String getReturn1() {
return return1;
}
}
error:
18:53:46,233 INFO [stdout] (default-short-running-threads-threads - 49) com.appiancorp.suiteapi.common.exceptions.AppianException: Unable to match input for class class com.appiancorp.services.WebServiceContext
Cancel
Vote Up
-1
Vote Down
Sign in to reply
Verify Answer
Reject Answer
Cancel
Reply
+1
ankitb0003
Certified Lead Developer
over 11 years ago
i have included WebServiceContent i am getting following error.18:53:46,233 INFO [stdout] (default-short-running-threads-threads - 49) com.appiancorp.suiteapi.common.exceptions.AppianException: Unable to match input for class class com.appiancorp.services.WebServiceContext
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import com.appiancorp.suiteapi.common.Name;
import com.appiancorp.suiteapi.content.ContentService;
import com.appiancorp.suiteapi.process.exceptions.SmartServiceException;
import com.appiancorp.suiteapi.process.framework.AppianSmartService;
import com.appiancorp.suiteapi.process.framework.Input;
import com.appiancorp.suiteapi.process.framework.MessageContainer;
import com.appiancorp.suiteapi.process.framework.Required;
import com.appiancorp.suiteapi.process.framework.SmartServiceContext;
import com.appiancorp.services.*;
import javax.servlet.http.HttpSession;
import com.appiancorp.suiteapi.process.palette.PaletteInfo;
@PaletteInfo(paletteCategory = "Integration Services", palette = "Connectivity Services")
public class getSessionIdSS extends AppianSmartService {
private static final Logger LOG = Logger.getLogger(getSessionIdSS.class);
private final SmartServiceContext smartServiceCtx;
private String param0;
private String param1;
private String sessionID;
private String return1;
private WebServiceContext webServiceContext;
//private ASLIdentity aSLIdentity;
private ContentService _cs;
private HttpSession httpSession;
@Override
public void run() throws SmartServiceException {
httpSession=(HttpSession)webServiceContext.getSession();
System.out.println(httpSession.getId());
sessionID=httpSession.getId();
}
public getSessionIdSS(SmartServiceContext smartServiceCtx, ContentService _cs, WebServiceContext webServiceContext) {
super();
this.smartServiceCtx = smartServiceCtx;
this._cs=_cs;
this.webServiceContext=webServiceContext;
}
public void onSave(MessageContainer messages) {
}
public void validate(MessageContainer messages) {
}
@Input(required = Required.OPTIONAL)
@Name("param0")
public void setParam0(String val) {
this.param0 = val;
}
@Input(required = Required.OPTIONAL)
@Name("param1")
public void setParam1(String val) {
this.param1 = val;
}
@Name("SessionID")
public String getSessionID() {
return sessionID;
}
@Name("return1")
public String getReturn1() {
return return1;
}
}
error:
18:53:46,233 INFO [stdout] (default-short-running-threads-threads - 49) com.appiancorp.suiteapi.common.exceptions.AppianException: Unable to match input for class class com.appiancorp.services.WebServiceContext
Cancel
Vote Up
-1
Vote Down
Sign in to reply
Verify Answer
Reject Answer
Cancel
Children
No Data