Skip to content

Instantly share code, notes, and snippets.

@floverfelt
Created October 17, 2020 12:27
Show Gist options
  • Save floverfelt/adfa0cc4730ed8eb8c8a3f3d4ecc7045 to your computer and use it in GitHub Desktop.
Save floverfelt/adfa0cc4730ed8eb8c8a3f3d4ecc7045 to your computer and use it in GitHub Desktop.
Creating an iServerSession with MSTR Web SDK
private static WebIServerSession getAdminWebIServerSession(String mstrServerName, int mstrServerPort, String mstrProjectName, String mstrUsername,
String mstrPassword) throws WebObjectsException {
WebIServerSession webIServerSession = WebObjectsFactory.getInstance().getIServerSession();
// Spawn adminSession for work
webIServerSession.setServerName(mstrServerName);
webIServerSession.setServerPort(mstrServerPort);
webIServerSession.setProjectName(mstrProjectName);
webIServerSession.setLogin(mstrUsername);
webIServerSession.setPassword(mstrPassword);
// WebSDK code is defined as a CustomApp
webIServerSession.setApplicationType(EnumDSSXMLApplicationType.DssXmlApplicationCustomApp);
// Reconnect forces re-validation of session
webIServerSession.reconnect();
return webIServerSession;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment