Azeez
Nice approach. Another option is to use Synapse to route requests that
come into the single "service" to the actual real services that are
deployed using a filter.
Paul
On Jan 25, 2008 1:17 PM, Afkham Azeez <[EMAIL PROTECTED]> wrote:
> You cannot deploy 2 different AAR files and expect the operations to be
> merged at runtime. If you create two AAR files, the default behavior is that
> to create 2 service groups. So even if the service name is the same, these
> will be two different services. Having said that, you can add operations to
> services at runtime. Here is one way of doing that:
>
> e.g. add an in-out operation barOp to the FooService;
>
> Define a Axis2 listener as follows:
>
> package test;
>
> import org.apache.axiom.om.OMElement;
> import org.apache.axis2.AxisFault;
> import org.apache.axis2.description.AxisModule;
> import org.apache.axis2.description.AxisService;
> import org.apache.axis2.description.AxisServiceGroup;
> import org.apache.axis2.description.InOutAxisOperation;
> import org.apache.axis2.description.Parameter;
> import org.apache.axis2.engine.AxisConfiguration;
> import org.apache.axis2.engine.AxisEvent;
> import org.apache.axis2.engine.AxisObserver;
>
> import javax.xml.namespace.QName;
> import java.util.ArrayList;
>
> public class OperationAdder implements AxisObserver {
> private AxisConfiguration axisConfig;
>
> public void init(AxisConfiguration axisConfiguration) {
> this.axisConfig = axisConfiguration;
> }
>
> public void serviceUpdate(AxisEvent axisEvent, AxisService axisService)
> {
> if(axisEvent.getEventType() == AxisEvent.SERVICE_DEPLOY){
> if(axisService.getName().equals("FooService")){
> InOutAxisOperation op = new InOutAxisOperation(new
> QName("barOp"));
> axisService.addOperation(op);
> }
> }
> }
> ...
> }
>
> Next, in your axis2.xml, add the following entry;
>
> <listener class="test.OperationAdder"/>
>
> That's it!
>
> HTH
> Azeez
>
>
>
>
> On Mon, Jan 21, 2008 at 9:26 PM, Shine, Kenneth <[EMAIL PROTECTED]> wrote:
> >
> >
> > > Is it possible to split the operations of a single service into multiple
> AAR files? For example, the StockQuoteService service in the Quick Start
> Guide, <http://ws.apache.org/axis2/1_3/quickstartguide.html#services>, has a
> getPrice and an update operation. Can I break that into two AAR files, one
> that specifies operation getPrice and one that specifies operation update,
> but both still having the same service name so that I can still call them
> like so:
> > >
> > >
> http://localhost:8080/axis2/services/StockQuoteService/getPrice?symbol=IBM
> > > http://localhost:8080/axis2/services/StockQuoteService/update
> > >
> > > I wish to do since because I want to add more operations to an existing
> service after initial deployment without having to alter the existing
> deployed AAR file.
> > >
> > > I assume I cannot do this since Axis will see this as two different
> services with the same name instead of one service in two parts.
> > >
> > > Thanks for the help
> > >
> > > Ken
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> --
> Thanks
> Afkham Azeez
>
> http://azeez78.blogspot.com
> http://www.wso2.org
> GPG Fingerprint: 643F C2AF EB78 F886 40C9 B2A2 4AE2 C887 665E 0760
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
[EMAIL PROTECTED]
"Oxygenating the Web Service Platform", www.wso2.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]