Your SAS programs, embedded in web apps and elsewhere

Remotely calling a stored process from stand-alone Java app

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 (

//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();

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

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();

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


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.


Posts: 8,869

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

Posted in reply to deleted_user
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 and in the left-hand navigation pane, click on the link entitled "Submit a Problem". Or go to this link, directly,

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation