Hello everyone,
At work, I have access to a SAS 9.4 Workspace Server through SAS Enterprise Guide 7.1. The problem is that I'm trying to create a Java client, but I can't get access to te Workspace Server.
The first step that I do is to connect to the Metadata Server, then I try to connect to the workspace server, but I can't use the same user and password that I've used to connect to the Metadata Server. In Fact, when I inspect the properties of the server in SAS Enterprise guide, it looks like that it connects to the Workspace Server as a user named sassrv.
I'm not an admin nor I have access to someone related to that, so I can't make or request a reconfiguration.
¿Is there any way to get that sassrv info? or ¿do I need to consider something else?
The following code is the one that I'm using right now:
public class PruebaSAS94_2 {
public static void main(String[] argv) {
String classID = Server.CLSID_SASOMI;
String host = "zzzz.xxxx.yyyy.com";
int port = 8561;
Server server = new BridgeServer(classID,host,port);
ConnectionFactoryConfiguration cxfConfig_omr = new ManualConnectionFactoryConfiguration(server);
ConnectionFactoryManager cxfManager = new ConnectionFactoryManager();
try {
ConnectionFactoryInterface cxf = cxfManager.getFactory(cxfConfig_omr);
//cxfManager.
String userName = "myuser";
String password = "MyPassword";
//this connection to the MetaData Server works fine
ConnectionInterface cx_omr = cxf.getConnection(userName,password);
org.omg.CORBA.Object obj_omr = cx_omr.getObject();
IOMI iOMI = IOMIHelper.narrow(obj_omr);
// Step 5. Create a connection factory configuration for the server by passing
// the server logical name to the metadata server.
String reposID = "A0000001.XXXXXXXX";
String reposName= "Foundation";
String logicalServerID = "A53ONYSW.YYYYYYYY";
String logicalServerName= "SASApp - Logical Workspace Server";
ConnectionFactoryConfiguration cxfConfig =
new OMRConnectionFactoryConfiguration(iOMI,reposID,logicalServerName);
//System.out.println(cxfConfig.getRepositoryID());
// Step 6: Get a connection factory that matches the server's connection
// factory configuration.
ConnectionFactoryInterface cxf2 = cxfManager.getFactory(cxfConfig);
//cxf2.
// Set the credentials for the server connection.
String user = userName;
String pass = password;
String domain = "DefaultAuth";
// Step 7: Get a connection to the server.
ConnectionInterface cx = cxf2.getConnection(user,pass,domain);
// Step 8: Narrow the connection from the server.
org.omg.CORBA.Object obj = cx.getObject();
IWorkspace iWorkspace = IWorkspaceHelper.narrow(obj);
if(iWorkspace == null) System.out.println("This is null");
} catch (ConnectionFactoryException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
BTW, the connection to the metadata server works fine, in fact, I got the repoId and logical server name from it.
SAS Enterprise didn't required any special configuration to connect to the metadata server and use the workspace server (That is located in another virtual? machine).
The error that I get in my java client, when I try to connect to the Workspace Server, is that my user or the password is incorrect.
regards,
Jaime
Shouldn't this be the same as what's in your screenshot?
int port = 8561;
If not is this port open or do you get different results by changing this to a different port?
Hi Krueger,
The port that's shown in the screenshot belongs to the Workspace Server port, that's located in a different host. The port 8561 corresponds to the Metadata Server port, and I can't get a connection to the Workspace Server if I don't have a connection to the Metadata Server, at least from SAS 9.X. The port and host of the Workspace server are handled in the following line:
ConnectionFactoryConfiguration cxfConfig = new OMRConnectionFactoryConfiguration(iOMI,reposID,logicalServerName);
The problem is that I don't know how to connect to the Workspace Server with the data that I got from the Metadata Server.
Maybe the domain is wrong and there's a way to get the right one, I don't know, but it doesn't recognize my user and password. I don't have a problem with the port.
You can directly make a call to the IOM server - Object spawner using Java code. Is there a reason you want to get attributes from Metadata? Link here with some details:
https://support.sas.com/rnd/itech/doc9/dev_guide/dist-obj/javaclnt/javaprog/connfact_direct.html
Hi Anand, thank you for your answer, but it didn't solve my problem. I don't have straight access to the Workspace Server. It throws the same exception:
com.sas.services.connection.InvalidCredentialsException: The application could not log on to the server "eccdlvsascp1.XXXX.YYYY.com:8591". The user ID "jortega" or the password is incorrect.
Even in SAS Enterprise Guide I need to supply the Metadata Server info in order to connect... maybe that's happening because SAS is using Active Directory, because I need to supply the same user and password that I use to log into my Windows Machine, even when I change my password. I haven't found information about this.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: