[jdom-interest] Passing Element parameter in Jax-ws web method

Dehaene Thomas Thomas.Dehaene at howest.be
Sat Mar 17 08:14:42 PDT 2012


I have a problem when accepting a web parameter of the type Element. My code is as follows:

    @WebMethod(operationName = "hello")
    public void hello(@WebParam(name = "xmlElement") Element element){
        String name = new String();
        name = element.getChild("FirstName").getValue();


Which generates an error when I try to deploy the web service. Namely that the Element class
does not have a no-arg constructor.

If this where a normal method, I would simply make it a 'public static void' method,
but since WebMethods in Jax-ws can't be of the 'final' or 'static' type, I can't seem to
accept an Element parameter.

Any suggestions how to solve this?

Many thanks and greetings

Thomas Dehaene

More information about the jdom-interest mailing list