axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erlloyd <>
Subject Possible to configure a web service in its constructor?
Date Sun, 16 Nov 2008 20:01:18 GMT


For a project for school, I'm trying to do something pretty unorthodox with
axis2 web services, and I'm wondering if it is possible. Here's the

I have one POJO, and hence 1 .class file representing a web service. This
web service is stateful (services.xml has 'application' scope). 

However, I create 2 .aar files, both with the same .class file, both with
the same services.xml file, the only difference being their names. Say, for
example, they are Service0.aar and Service1.aar.

Now, my problem is that I want each of these services to publish themselves
in a UDDI registry when they are deployed (ie, when their constructor is
called) but they need to register themselves with different names. However,
since they use the same .class file, the java objects don't know they are
different at construction. 

I tried setting a parameter in services.xml and giving each service its own
services.xml and reading that in during the construction, but it didn't
work. You seem to need a MessageContext to read in parameters, and a call to
MessageContext.getCurrentMessageContext() in the constructor returned null.

Also, I can't use a static class variable, because these two services may be
deployed on different computers.

Does anyone have any suggestions for me?

View this message in context:
Sent from the Axis - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message