This totally depends on the way you decide to implement it. You may maintain
the configuration context as a static attribute or a property in a
ServletContext etc. MessageContext.getCurrentMessageContext will return the
correct message context only if a relevant flow was initiated through a Web
service request.
e.g. Like in WSAS (which uses embedded Tomcat), you can have an Admin
service which can be invoked to do something like this. Here is a service
implementation class.
public class ServiceAdderAdmin {
public void deployService(){
MessageContext msgCtx = MessageContext.getCurrentMessageContext
();
AxisConfigruation axisConfig = msgCtx.getRootContext
().getAxisConfiguration();
AxisService service = new AxisService();
...
axisConfig.addService(axisService);
}
}
HTH
Azeez
On Tue, Jan 29, 2008 at 7:10 PM, Martin Philippi <[EMAIL PROTECTED]> wrote:
> Hi!
> I'm developing an application with an embedded tomcat.
> I want to deploy a Axis2-Webservice at runtime.
> My problem is: How do i get the current ConfigurationContext to add the
> service to it?
> I can create a new ConfigurationContext and add the service, but that does
> not have any effect.
>
> ConfigurationContext configContext =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem
> ("c:/axis2-1.3/conf/axis2.xml");
> InputStream in = new
> FileInputStream("c:/workspace/mywebservice/services.xml");
> AxisService service = DeploymentEngine.buildService(in, configContext);
> configContext.getAxisConfiguration().addService(service);
> configContext.getAxisConfiguration().startService("SMARTService");
>
> Regards,
> Martin
> --
> Psssst! Schon vom neuen GMX MultiMessenger gehört?
> Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Thanks
Afkham Azeez
http://azeez78.blogspot.com
http://www.wso2.org
GPG Fingerprint: 643F C2AF EB78 F886 40C9 B2A2 4AE2 C887 665E 0760