users@jax-rpc.java.net

Re: Generated Service-Configuration File

From: Armond Avanes <armond333_at_YAHOO.COM>
Date: Mon, 25 Feb 2002 22:36:08 -0800

Hi Arun,

Really thanks for your reply and explanations.

Well, my services are in different package so I should
go the second solution. But won't there be any
overhead if I have 20 different services in my system
and have to specify that Servlet 20 times? How do the
Servlet Containers usually behave in these situations?
How about the RPC servlet itself? Is it optimized in
this case?

As I mentioned in my email, I've gone a third
solution. Please let me know how you see and compare
it with these two solutions: I noticed that
JAXRPCServlet has the capabilities to accept one
config file which contains all config properties for
all the services. So I generated that single config
file by myself and it's working ok. Here is the
structure:

port0.tie=MY.PACKAGE.NAME1.AService_Tie
port0.servant= MY.PACKAGE.NAME1.AServiceImpl
port0.name=AService
port0.wsdl.targetNamespace=http://www.test.com/wsdl
port0.wsdl.serviceName=AService
port0.wsdl.portName=AServicePort

port1.tie=MY.PACKAGE.NAME2.BService_Tie
port1.servant= MY.PACKAGE.NAME2.BServiceImpl
port1.name=BService
port1.wsdl.targetNamespace=http://www.test.com/wsdl
port1.wsdl.serviceName=BService
port1.wsdl.portName=BServicePort

port2.tie=MY.PACKAGE.NAME3.CService_Tie
port2.servant= MY.PACKAGE.NAME3.CServiceImpl
port2.name=CService
port2.wsdl.targetNamespace=http://www.test.com/wsdl
port2.wsdl.serviceName=CService
port2.wsdl.portName=CServicePort

portcount=3

Best Regards,
Armond

> -----Original Message-----
> From: Public discussion on JAX-RPC
> [mailto:JAXRPC-INTEREST_at_JAVA.SUN.COM]
> On Behalf Of Arun Gupta
> Sent: Monday, February 25, 2002 9:07 PM
> To: JAXRPC-INTEREST_at_JAVA.SUN.COM
> Subject: Re: Generated Service-Configuration File
>
> 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
> =============================================


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com