Here is how we've done this in WSAS. We've written Admin services called
ServiceAdmin[1] & ServiceGroupAdmin[2]. So a WS client can call these admin
services to stop/start services and also remove services.

Here is the relevant code snippet from ServiceAdmin
    public void stopService(String serviceName) throws Exception {
        AxisService axisService =
getAxisConfig().getServiceForActivation(serviceName);
        if (axisService == null) {
            throw new Exception("Invalid service name " + serviceName);
        }

        try {
            getAxisConfig().stopService(serviceName);
        } catch (AxisFault e) {
            String msg = "Cannot stop service " + serviceName;
            log.error(msg, e);
            throw new Exception(msg);
        }
    }

For deleting services, see the ServiceGroupAdmin#deleteServiceGroup(String
serviceGroupName)  method.

In these cases, you could get hold of the AxisConfiguration as follows:

MessageContext.getCurrentMessageContext
().getRootContext().getAxisConfiguration()

HTH
Azeez

1.
https://wso2.org/repos/wso2/trunk/wsas/java/modules/admin/src/org/wso2/wsas/admin/service/ServiceAdmin.java
2.
https://wso2.org/repos/wso2/trunk/wsas/java/modules/admin/src/org/wso2/wsas/admin/service/ServiceGroupAdmin.java





On Jan 23, 2008 4:26 PM, Thanh Lan <[EMAIL PROTECTED]> wrote:

> Hello all.
>
> I am new to Axis2 and I want to stop or remove or un-registered a
> deployed web services programmatically. But I can't find any useful
> information. Can you show me any code snippets?
>
> Thanks you very much. Best wishes to you.
>
> --
> http://www.fastmail.fm - Or how I learned to stop worrying and
>                          love email again
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Thanks
Afkham Azeez

http://www.wso2.org
GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760

Reply via email to