axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "I-Sampige, Srinivas" <srinivas.samp...@boeing.com>
Subject RE: <init-param> ...getting null values
Date Fri, 12 Dec 2003 20:38:28 GMT
Aaron,
I got it working after some close analysis and trial and error. I had place the parameters
in the wrong section using the wrong tags. This is what I had to do -
----------------------------------------
<web-app>
  <display-name>Apache-Axis</display-name>

  <!-- initialization parameters for all web services/web apps deployed in this context.
-->

  <!-- the demo .fo file for the FOP Web Service-->
  <context-param>
    <param-name>demoFoFileName</param-name>
    <param-value>demoFoFile.fo</param-value>
    <description>foo desc</description>
  </context-param>
-------------------------------------

>ServiceLifecycle params and web.xml init params have nothing to do with 
>each other.

>Service params are configured in your WSDD.  Furthermore, 
>ServiceLifecycle init method will NOT be called if implement it in your 
>*Impl class.  You must implement it in your *Skeleton class (modify the 
>generated source).  If you want your *Impl class to implement it, you 
>must implement it in your Skeleton then manually call down to the 
>implementation.

 It appears this is not the case. My init method gets called and I have access to the params
from web.xml(after making the change above). Please see http://ws.apache.org/axis/java/apiDocs/javax/xml/rpc/server/ServiceLifecycle.html#init(java.lang.Object)
& http://ws.apache.org/axis/java/apiDocs/javax/xml/rpc/server/ServletEndpointContext.html

Thanks
Srinivas











-----Original Message-----
From: Aaron Hamid [mailto:arh14@cornell.edu] 
Sent: Thursday, December 11, 2003 7:53 PM
To: axis-user@ws.apache.org
Subject: Re: <init-param> ...getting null values


ServiceLifecycle params and web.xml init params have nothing to do with 
each other.

Service params are configured in your WSDD.  Furthermore, 
ServiceLifecycle init method will NOT be called if implement it in your 
*Impl class.  You must implement it in your *Skeleton class (modify the 
generated source).  If you want your *Impl class to implement it, you 
must implement it in your Skeleton then manually call down to the 
implementation.

My expectation was that ServiceLifecycle would apply to the *Impl class, 
and I would would vote to change this behavior so that is the case.

Aaron Hamid

I-Sampige, Srinivas wrote:

>Hi
> I have implemented the ServiceLifecycle interface method in my web service implementation
class and trying to read some input parameters from my web.xml. But, I don't see the input
parameters at all in my "init" method even though I am able to print out other details like
the real path to a couple of folders. Any ideas? Would be extremely grateful if somebody can
take a quick look at this and help. I looked for typos in the web.xml but couldn't find any.
Went to the extent of copying the init parameter section from the "SOAPMonitorService" of
the web.xml.   Please see below for complete details -
>
>Configuration - Axis 1.1; Tomcat 4.1.27; Java version is 1.4.2.
>
>Output that comes on the console ( web.xml and code snippets are pasted 
>after the output)-
>--------------------------------------------------------------------------------------------------------------------
>This is the init method of the service implementation-----
>parameter names ----
>
>
>attribute names ---
>org.apache.catalina.jsp_classpath
>javax.servlet.context.tempdir
>org.apache.catalina.resources
>AxisEngine
>org.apache.catalina.WELCOME_FILES
>
>
>Getting parameter values......
>firstParam null
>secondParam null
>
>
>Misc values extracted from context......
>server into Apache Tomcat/4.1.27
>real path of / C:\workarea\ebtcWebServices\
>real path of /docs C:\workarea\ebtcWebServices\docs
>ctx.getMajorVersion() 2
>ctx.getMinorVersion() 3
>-----------------------------------------------------------------------
>---------------------------------------------
>
>The relevant snippet from my web.xml -
>----------------------------------------------------------------------------------------
><web-app>
>  <display-name>Apache-Axis</display-name>
>  <servlet>
>    <servlet-name>AxisServlet</servlet-name>
>    <display-name>Apache-Axis Servlet</display-name>
>    <servlet-class>
>        org.apache.axis.transport.http.AxisServlet
>    </servlet-class>
>
>    <init-param>
>      <param-name>firstParam</param-name>
>      <param-value>firstValue</param-value>
>    </init-param>
>
>    <init-param>
>      <param-name>secondParam</param-name>
>      <param-value>secondValue</param-value>
>    </init-param>
>  </servlet>
>-----------------------------------------------------------------------
>-----------------
>
>My init method looks like this-
>-----------------------------------------------------------------------
>------------------
>  public void init(Object context)
>  {
>    System.out.println("This is the init method of the service implementation-----");
>
>    ServletEndpointContext servletEndPointCtx = (ServletEndpointContext) context;
>    ServletContext ctx = servletEndPointCtx.getServletContext();
>
>    System.out.println("parameter names ----");
>    Enumeration paramNames = ctx.getInitParameterNames();
>    while (paramNames.hasMoreElements())
>    {
>      System.out.println(paramNames.nextElement());
>    }
>    System.out.println("");
>    System.out.println("");
>
>    System.out.println("attribute names ---");
>    Enumeration attributes = ctx.getAttributeNames();
>    while (attributes.hasMoreElements())
>    {
>      System.out.println(attributes.nextElement());
>    }
>    System.out.println("");
>    System.out.println("");
>
>    System.out.println("Getting parameter values......");
>    System.out.println("firstParam "+ctx.getInitParameter("firstParam"));
>    System.out.println("secondParam "+ctx.getInitParameter("secondParam"));
>    System.out.println("");
>    System.out.println("");
>
>    System.out.println("Misc values extracted from context......");
>    System.out.println("server into "+ctx.getServerInfo() );
>    System.out.println("real path of / "+ ctx.getRealPath("/"));
>    System.out.println("real path of /docs "+ ctx.getRealPath("/docs"));
>    System.out.println("ctx.getMajorVersion() "+ctx.getMajorVersion());
>    System.out.println("ctx.getMinorVersion() "+ctx.getMinorVersion());
>  }
>----------------------------------
>
>Thanks
>Srinivas
>
>  
>


Mime
View raw message