axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Afkham Azeez" <afk...@gmail.com>
Subject Re: get current ConfigurationContext with embedded tomcat
Date Wed, 30 Jan 2008 10:21:05 GMT
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 <maph@gmx.de> 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: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Thanks
Afkham Azeez

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

Mime
View raw message