users@jax-rpc.java.net

Re: Support for JAX-RPC on SunOne WebServer 6.0

From: Vishal Goenka <vgoenka_at_CAMPUSPIPELINE.COM>
Date: Wed, 02 Oct 2002 13:16:03 -0600

Hi Richard,

Thanks for the reply. Are you using JWSDP 1.0.01 or an earlier version?

I had been able to get the early access to work a long time ago without any problem, however the latest release (including java xml summer update 02) seems to have some incompatible changes.

I built my service starting from Java, used wsdeploy to generate the jaxrpc-ri-runtime.xml etc. but kept on getting

[INFO] http - -JAX-RPC servlet initializing
[WARN] http - -missing context information

during startup. Looking at the community source, it was evident that the released code is not supposed to work with a Servlet Container that does not support Servlet Specification 2.3. The servlet container in iPlanet WebServer 6.0 SP2 only supports Servlet Spec 2.2 (with modifications for the servlet filter support) and SP3/SP4 release notes do not indicate a support for version 2.3 support either.

The generated web.xml adds the class com.sun.xml.rpc.server.http.JAXRPCContextListener as a javax.servlet.ServletContextListener (a Servlet Spec. 2.3 artifact), which is responsible for reading the jaxrpc-ri-runtime.xml file containing the endpoint definition. The iPlanet WebServer's servlet container never invokes the contextInitialized(...) method of the com.sun.xml.rpc.server.http.JAXRPCContextListener, and as a result, the endpoint definition is never known to the JAXRPCServlet.

On a finer note, if there are any JAXRPC RI Team members on the list, the JAXRPCContextListener class tries to open the file "WEB-INF/jaxrpc-ri-runtime.xml", which fails using the getResourceAsStream() method. The ServletContainer for iPlanet WebServer complains that the URL must start with a "/".

So, in order to get it to work, I had to do the following kludge.

1. Modify JAXRPCServletDelegate's init method to include the code that is present in JAXRPCContextListener so that the endpoint definition is read.

2. Changed the file "WEB-INF/jaxrpc-ri-runtime.xml" to "/WEB-INF/jaxrpc-ri-runtime.xml"

Thanks to the Community Source for jaxrpc runtime, I was able to proceed and not pull all my hair out wondering what is going on!

No wonder, JAXRPC does not claim that it is tested with Sun's own web server. It does not work yet! Oh well ...

--Vishal


On Wed, 2 Oct 2002 10:49:10 +1000, Atkins, Richard <rjatkins_at_AVAYA.COM> wrote:

>Hi John,
>
>> > The URL your client is using needs to have the name of the interface
>> (the
>> > port, in web services terminology) you're trying to invoke in it.
>> >
>> > Eg, from the hello example from the JWSDP tutorial, the endpoint is
>> mapped
>> > to "/hello", and it defines an interface HelloIF in the hello package.
>> To
>> > access this, you need a URL like http://localhost/hello/HelloIF.
>>
>> Is it possible to have multiple ports for the same service, i.e
>> http://localhost/hello/HelloIF1
>> http://localhost/hello/HelloIF2
>> etc
>> ?
>
>Yes it is. You just need to add another <interface> declaration to your
><service> definition in your config.xml (if you're generating a wsdl from
>java classes with wscompile or xrpcc). I'm not sure how you could go about
>doing the same for wsdl to java, or how this would work with wsdeploy.
>
>See http://java.sun.com/webservices/docs/1.0/jaxrpc/ReleaseNotes.html for
>the syntax of the wscompile and wsdeploy xml files, and
>http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXRPCxrpcc.html for
>the syntax of the xrpcc xml file.
>
>I have this successfully working using xrpcc and generating the wsdl from
>java, and adding the required servlet and servlet-mapping for JAXRPCServlet
>to my web.xml by hand.
>
>Let me (and the rest of the list) know if you get it working using wscompile
>and wsdeploy starting from a wsdl file.
>
>Richard