(a) You could obtain the ServletContext via:

HttpServlet servlet = (HttpServlet
)MessageContext.getCurrentContext().getProperty(org.apache.axis.transport.http.HTTPConstants.MC_HTTP_SERVLET);
ServletContext context = servlet.getServletContext();

(b) Yes you can use * as a value of allowedMethods. However "message" style
services in Axis support only a single operation with one of the 4
acceptable signature types (look up the Axis user guide for the
signatures). If you specify the allowedMethods value as * or in absence of
any metadata, I believe (not 100% sure) Axis would invoke the first method
with an acceptable signature that it finds via introspection of your class.

Hope that helps.

- Junaid




                                                                                       
                                                
                      Rakesh Kant                                                      
                                                
                      <[EMAIL PROTECTED]        To:       [EMAIL PROTECTED]            
                                           
                      bm.com>                  cc:                                     
                                                
                                               Subject:  two-part question !           
                                                
                      08/08/2003 12:16                                                 
                                                
                      PM                                                               
                                                
                      Please respond to                                                
                                                
                      axis-user                                                        
                                                
                                                                                       
                                                
                                                                                       
                                                








Hi,

I have two rather unrelated question.

(a) Is there a way to get reference to servletContext object from the user
method implementing a service in AXIS?  For example if i deployed a service
with following deploy.wsdd

<deployment xmlns="http://xml.apache.org/axis/wsdd/";
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>
    <service name="gsd" style="message">
        <parameter name="className" value="com.my.company.MyService"/>
        <parameter name="allowedMethods" value="processRequest"/>
        <parameter name="enableRemoteAdmin" value="false"/>
    </service>
</deployment>

Then can I get access to servletContext object (the context where
AxisServlet is running) in processRequest method of
com.my.company.MyService.java class.

(b) In the above deployment can we use * as value of "allowedMethods"
parameter. If yes then how does AXIS map a request to different methods in
com.my.company.MyService.java class.  For example if I have 2 methods in
com.my.company.MyService.java class 1) processRequest 2) processCommand
then how can I invoke a message style service to this class and distinguish
between which method to invoke for processing the request.

Thanks,
Rakesh




Reply via email to