users@jax-rpc.java.net

Re: Generated Service-Configuration File

From: Arun Gupta <arun.gupta_at_Sun.COM>
Date: Mon, 25 Feb 2002 09:36:55 -0800

Hi Armond,

You can either specify three "service" interfaces as following in your
config file:

<service name="ABC" packageName="YOUR_PACAKGE_NAME">
  <interface name="AService"
             servantName="AServant"/>
  <interface name="BService"
             servantName="BServant"/>
  <interface name="CService"
             servantName="CServant"/>
</service>

In this case, there will be only one configuration file generated. You
can continue to use the web.xml as given in the tutorial in this case.

However if you do need to keep them as three separate services, then
your config file will look like:

<service name="AService" packageName="YOUR_PACAKGE_NAME">
  <interface name="AService"
             servantName="AServant"/>
</service>
<service name="BService" packageName="YOUR_PACAKGE_NAME">
  <interface name="BService"
             servantName="BServant"/>
</service>
<service name="CService" packageName="YOUR_PACAKGE_NAME">
  <interface name="CService"
             servantName="CServant"/>
</service>

And as you expected, it'll generate three different config files. In
this case your web.xml will have to have multiple <servlet/> entries
with each entry mapping a config file to JAXRPCServlet. Here is a sample
web.xml for your reference:

<servlet>
   <servlet-name>AServiceEndpoint</servlet-name>

<servlet-class>com.sun.xml.rpc.server.http.JAXRPCServlet</servlet-class>
   <init-param>
      <param-name>configuration.file</param-name>
      <param-value>/WEB-INF/AService_Config.properties</param-value>
   </init-param>
   <load-on-startup>0</load-on-startup>
</servlet>
<servlet>
   <servlet-name>BServiceEndpoint</servlet-name>

<servlet-class>com.sun.xml.rpc.server.http.JAXRPCServlet</servlet-class>
   <init-param>
      <param-name>configuration.file</param-name>
      <param-value>/WEB-INF/BService_Config.properties</param-value>
   </init-param>
   <load-on-startup>0</load-on-startup>
</servlet>
<servlet>
   <servlet-name>CServiceEndpoint</servlet-name>

<servlet-class>com.sun.xml.rpc.server.http.JAXRPCServlet</servlet-class>
   <init-param>
      <param-name>configuration.file</param-name>
      <param-value>/WEB-INF/CService_Config.properties</param-value>
   </init-param>
   <load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
   <servlet-name>AServiceEndpoint</servlet-name>
   <url-pattern>/jaxrpc/aservice/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
   <servlet-name>BServiceEndpoint</servlet-name>
   <url-pattern>/jaxrpc/bservice/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
   <servlet-name>CServiceEndpoint</servlet-name>
   <url-pattern>/jaxrpc/cservice/*</url-pattern>
</servlet-mapping>

Assuming your context root is "foo" and you've deployed your service at
localhost:8080, your three services will be accessible at the following
endpoints:

http://localhost:8080/foo/jaxrpc/aservice
http://localhost:8080/foo/jaxrpc/bservice
http://localhost:8080/foo/jaxrpc/cservice

Hope that answers your question.

Thanks for your interest in JAX-RPC.

Regards,
-Arun

Armond Avanes wrote:
>
> Hi JaxRPC Gurus,
>
> It?s a while I?ve downloaded and am using JaxRPC but
> I?ve got into an annoying bug on xRPCc tool. I wanna
> know if there is any solution.
>
> Well, I have 3 ?service? interfaces and
> implementations here (say AService, BService and
> CService). When I run xRPCc tool on these services it
> generates 3 configuration files
> (AService_Config.properties,
> BService_Config.properties,...) actually one for each
> service.
>
> On the other hand the main servlet, which is
> responsible to take the requests and dispatches them
> to available installed services, only accepts ONE
> configuration file as parameter. Seems that all the
> services configurations should be in one file but as I
> mentioned xRPCc tool generates one for each service.
>
> Any workaround for this bug?
>
> Currently I create the services configuration file by
> myself and delete the generated ones by xRPCc.
>
> Thanks for your time,
> Armond
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games
> http://sports.yahoo.com

--
=============================================
There is only one me, I must live myself!
There is only one today, I must live itself!
=============================================
http://members.tripod.com/~apgupta/index.html
=============================================