BookmarkSubscribeRSS Feed
bream_bn
Fluorite | Level 6

Does anyone have any experience connection to the SAS Workspace Server from Java and then grabbing the SessionService Object? I have followed this tutorial, http://support.sas.com/documentation/cdl/en/itechjcdg/62762/HTML/default/viewer.htm#connfact.htm , and have been able to make a connection. I know would like to grab and use the SessionService which I know is available by this article, http://support.sas.com/documentation/cdl/en/itechjcdg/62762/HTML/default/viewer.htm#found_session.ht... .

,

3 REPLIES 3
PaulHomes
Rhodochrosite | Level 12

Hi,

If you haven't seen them already you might want to have a look at the Javadocs:

Would you also be able to provide a little more background, or business examples, on what you are trying to do with regard to "connection to the SAS Workspace Server from Java and then grabbing the SessionService Object?".  It's possible, and quite easy, to get a simple SAS Workspace Server connection (see Connecting with Directly Supplied Server Attributes and Connecting with Server Attributes Read from a SAS Metadata Server) without using Foundation Services (you should even be able to connect to a workspace server via those mechanisms without foundation services running). I'm assuming from your question that you're using one of those techniques? If so, and you want/need to be using Foundation Services you might want to think about approaching this problem from the other direction and getting a workspace server connection from the Foundation Services infrastructure instead as (heavily summarized) in the Example of Connecting with Server Attributes from the Information Service. Whether you want/need that additional layer of Foundation Services complexity will depend on the problem you are trying to solve which is why a bit more background on the underlying business requirement might help.

Cheers

Paul

PaulHomes
Rhodochrosite | Level 12

By the way, this is shortest self-contained code (exception handling removed for simplicity) that I've personally been able to use to get access to remote SAS Foundation Services from a standalone Java app:

PlatformServicesConfiguration platformServicesConfig = new PlatformServicesConfiguration(null, new MetadataSourceInterface[] {
    PlatformServicesConfiguration.createMetadataSource( "sas-oma://sasmeta:8561;reposname=Foundation;", "sasadm@saspw", "secretpassword")
    });
CorePlatformServices.setServicesConfiguration(platformServicesConfig);
CorePlatformServices.startServices();
SessionServiceInterface sessionService = CorePlatformServices.getSessionService();
UserServiceInterface userService = CorePlatformServices.getUserService();
AuthenticationServiceInterface authService = CorePlatformServices.getAuthenticationService();
InformationServiceInterface infoService = CorePlatformServices.getInformationService();    
CorePlatformServices.terminateServices();

Other SAS & Java programmers might be able to give you alternative methods.

bream_bn
Fluorite | Level 6

Paul, this I had looked into the javadocs a bit. The information your provided in your second post is what I was looking for although I am still having trouble accomplishing my task. Essentially I have as Custom SAS Portlet with a Flash Application in it which are going to access data through Java/Blazeds services. What I would like to do is pass some SAS variable (SessionID is what I was looking for) to the Flash app which could then forward this to the Java Services and they could verify that this is a legitimate SAS Session before returning data.

sas-innovate-2024.png

Today is the last day to save with the early bird rate! Register today for just $695 - $100 off the standard rate.

 

Plus, pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 585 views
  • 0 likes
  • 2 in conversation