You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by David Wake <dw...@stanfordalumni.org> on 2004/01/21 01:56:25 UTC

Interactively deploy/undeploy services without using files

Is there any way for a Java application to deploy and undeploy
services and methods interactively in Apache Axis, without writing any
files?

In Apache SOAP this was possible by using the
org.apache.soap.server.DeploymentDescriptor class.  Is there an AXIS
equivalent?

Here's an example that worked with Apache SOAP.  I would like to know
if there's a way to do the same kind of thing in Apache AXIS.

Thanks,

David

/** Deploy a new operation MY_METHOD */
smc = new ServiceManagerClient (new URL(MY_SOAP_URL));
DeploymentDescriptor dd = smc.query(MY_SOAP_SERVICE_NAME);
if (dd == null)
{
    dd = new DeploymentDescriptor();
}
dd.setID(MY_SOAP_SERVICE_NAME);
dd.setServiceType(DeploymentDescriptor.SERVICE_TYPE_RPC);
dd.setScope(DeploymentDescriptor.SCOPE_APPLICATION);
dd.setProviderType(DeploymentDescriptor.PROVIDER_USER_DEFINED);
dd.setServiceClass("my.custom.provider.class");
String[] oldMethods = dd.getMethods();
if (oldMethods == null)
{
    oldMethods = new String[0];
}
ArrayList newMethodList = new ArrayList(Arrays.asList(oldMethods));
String methodName = getName();
if (!newMethodList.contains(MY_METHOD))
{
    newMethodList.add(MY_METHOD);
}
dd.setMethods((String[])newMethodList.toArray(new String[newMethodList.size()]));
smc.deploy(dd);