Your SAS programs, embedded in web apps and elsewhere

Remotely calling a stored process from stand-alone Java app

Reply
N/A
Posts: 0

Remotely calling a stored process from stand-alone Java app

Hi All,


I've been spending some time on trying to remotely access a stored process using foundation services. Unfortunately, I have not succeeded in connecting remotely to the stp service. The client I'm using is a standalone java-application, so I am not working from an application container.

So far, I've managed to be able to get an overview of the services available for remote discovery. Most of the deployment related stuff is based on an example found in the SAS samples (http://support.sas.com/kb/26/005.html):


//establish connection to metadata server and deploy services
final String applicationDeploymentName = "Remote Services";
final String[] deploygroups = new String[]{ "BIP Remote Services OMR","BIP Stored Process Service"};

Set deploys = new HashSet();
deploys.add(deploygroups[0]);
deploys.add(deploygroups[1]);

MetadataSourceInterface metadataSource = null;
// Create a metadata source for an Open Metadata Repository
final String serverIdentityPassword = SasPasswordString.encode(
SasPasswordString.SAS001_ENCODING, SERVER_IDENTITY_PASSWORD);

metadataSource = new OMRMetadataSource(SERVER_HOST, SERVER_PORT,
SERVER_IDENTITY_ID, serverIdentityPassword,
SERVER_REPOSITORY_NAME, applicationDeploymentName, deploys
);

// Obtain the discovery service
discoveryService = DiscoveryService.defaultInstance();

// Deploy the remote services using the created metadata source.
ServiceLoader.lookupRemoteDiscoveryServices(metadataSource, discoveryService);


I then list the available services in the discovery service as follows:


// returns the discovery service
// finds the first 20 services
// ensure that all services are listed
Services srv = mdsfc.getDiscoveryService().findServices(new ServiceTemplate(new Class[] { Object.class}), 20, null);
Iterator it = srv.iterator();
while(it.hasNext())
{
System.out.println(it.next().toString());
}


Much to my dismay, only the following proxies are in the list:

- com.sas.services.session.SessionServiceProxy
- com.sas.services.security.AuthenticationServiceProxy
- com.sas.services.discovery.RemoteDiscoveryServiceProxy
- com.sas.services.information.InformationServiceProxy
- com.sas.services.user.UserServiceProxy
- com.sas.services.logging.LoggingServiceProxy

The Stored process service is not in the list, even though it is defined in the platform service registry. Without the proxy to the stored process service I cannot execute my stored process. The other services are found and approachable.

The questions are a) what conditions does the stored process service have to meet in order to be listed in the discovery service and b) how should I configure my services deployment to have the stp service listed?

It could, of course, still be that I am deploying the services incorrectly. If this approach is completely wrong, please let me know. Documentation on this topic is slightly obscure, imho.

Any help would be greatly appreciated.


regards,


WG
SAS Super FREQ
Posts: 8,869

Re: Remotely calling a stored process from stand-alone Java app

Posted in reply to deleted_user
Hi:
This question is the kind best answered by SAS Tech Support. They have the technology and expertise to investigate your configuration and code and replicate your code, if necessary.

To open a track with Tech Support, go to http://support.sas.com/ and in the left-hand navigation pane, click on the link entitled "Submit a Problem". Or go to this link, directly, http://support.sas.com/ctx/supportform/createForm

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 261 views
  • 0 likes
  • 2 in conversation