axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark <m...@inomial.com>
Subject Using a different pattern to provide services
Date Mon, 19 Jan 2004 06:40:48 GMT
Hi

I have implemented quite a few web services using Axis in the past and I
think I have a reasonable understanding of how that side of things
works. But I now would like to do something a little more complex, on
the server side.

What I want to know is, if it is possible for me to write a handler that
can still decode (ie, convert from XML to Java) the named parameters
from a soap call - without writing a specific Java method? What I would
like to do is to create an object from the (decoded) SOAP parameters,
and to pass that to a class of my choosing.

For example, I would like to be able to implement a simple "add" service
using two classes (a data interface which holds the arguments to the
method, and a concrete implementation), as follows:

public interface AddProperties {
  BigDecimal getA();
  BigDecimal getB();
}

public class AddCommand {
  public Object execute(Object properties)
  {
    AddProperties addProperties = (AddProperties) properties;
    return addProperties.getA().add(addProperties.getB());
  }
}

I understand that I could just deploy a "BigDecimal add(BigDecimal a,
BigDecimal b)" but this approach doesn't match my needs. What I want to
know is, how I can intercept the SOAP processing, populate an object,
and then pass that object to another object - instead of just calling a
method in a class with the list of parameters?

So, like I say, I've written plenty of basic SOAP services before, but I
have no idea where to start looking in order to implement the above. For
example, is there a way that I can get the parameters of the SOAP method
call converted by Axis into the Java equivalents? How can I create and
deploy the same set of handlers or handler chains, on a large number of
methods?

I also need to be able to include some pre- and post-processing of the
message. I guess that I should use a handler chain to do this, but once
again I'm not sure where to start. Do I declare the handler chain in the
WSDD? Or in code? Do I have to declare it for every deployed service?

Thanks in advance for any help.

Cheers
Mark

Mime
View raw message