axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Michel PATER <pa...@cogenit.fr>
Subject Re: [AXIS2] Acces servlet context parameters
Date Mon, 18 Sep 2006 13:00:13 GMT
Hi,

I may missed something. I have implemented the setOperationContext 
method in my service implementation class (in the skeleton class). I 
have then a method like that in my skeleton :

>         public void setOperationContext(OperationContext opContext){
>             log.info("Entering setOperationContext");
>             ServiceContext serviceCtx = opContext.getServiceContext();
>             ConfigurationContext configCtx = 
> serviceCtx.getConfigurationContext();
>             if(configCtx == null) {
>                 log.error("setOperationContext --> configuration 
> context not initialized");
>                 return;
>             }            
>             servletCtx = 
> (ServletContext)configCtx.getProperty("transport.http.servletContext");
>                
>             if(servletCtx == null) {
>                 log.error("setOperationContext --> servlet context not 
> initialized");
>                 return;
>             }
>                
>             
>             CarsDB carsDB = 
> (CarsDB)servletCtx.getAttribute("carsCB");               
>                
>         }


But I always have " servlet context not initialized " in my log file.

The receiver class is the receiver generated from the WSDL2Java command 
line which extends 
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver


Deepal Jayasinghe wrote:
> You can do it using one step;
>
> (ServletContext)operationContext.getProperty(transport.http.servletContext);
>
> Thanks
> Deepal
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message