Axis webservice - Redirecting calls with a handler

P

Paco

Hi everybody,

I'm new to Axis and I need help getting functions redirected. Here is
the scenario:

We have a webservice with a defined interface that we must maintain.
It has functions like getX() and getY(). We want to change our code so
we only have one get() function that is used when any get_() request is
recieved. I have a handler to do this but I don't understand why it
functions like it does and it leads me to believe that I'm messing it
up.

If our service class has getX() and getY() methods defined then I can
use the MessageContext to get the OperationDesc and us its setMethod()
call to redirect it to our get() method.

However, we don't want to have empty getX() and getY() methods and if I
remove them it throws an exception when I call
messageContext.getOperation() (I'm assuming because the method getY()
does not exist). I fixed this by doing the following:

messageContext.setOperation(null);
OperationDesc opDesc = messageContext.getOperationByQName(new
QName("get"));
messageContext.setOperation(opDesc);

This works if the original Operation they requested does not exist.
However, if it does, it won't set it to the get() method and still
calls the old getY() method.

In essence, I want to have a class with only a get() method. However,
I want people to be able to send requests for a getY() method and have
my handler redirect it to the get() method. What is the proper way to
accomplish this?

Thanks,
Patrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top