Doubt Receiving Parameters (WebService Soap)

1

Well, I'm in the following scenario:

I have this class, it is a webservice (contains the @WebService method):

@WebService(name = "l", targetNamespace = "o")
    public abstract interface Service {

    @WebMethod(operationName = "Cancelar")
    @RequestWrapper(localName = "Cancelar", targetNamespace = "http://www.x.com.br/y/w", className = "br.com.x.y.w.CancelarRequest")
    @ResponseWrapper(localName = "CancelarResponse", targetNamespace = "http://www.x.com.br/y/w", className = "br.com.x.y.w.CancelarResponse")
    public abstract void Cancelar(
            @WebParam(name = "k", targetNamespace = "http://www.x.com.br/y/w", mode = WebParam.Mode.INOUT) Holder<String> paramHolder,
            @WebParam(name = "Result", targetNamespace = "http://www.x.com.br/y/w", mode = WebParam.Mode.OUT) Holder<ResultType> paramHolder1);
    }

My question is: if this class is a webservice because I define it as an "abstract interface", alias, - what happens when I define a class using "abstract interface". To this day I have only created classes that use one or the other.

Note that this class is the remote interface, it defines the remote services (@Method), but does not implement them, the whole implementation seems to be in the ServiceImpl class:

public class ServiceImpl implements Service     
    @Override
    public void Cancelar(
            Holder<String> k,
            Holder<ResultType> result) {

        CancelarP p = new CancelarP(ctx, k.value);
        CancelarResponseType execute = p.execute();
        ResultType resultType = execute.getResult();
        result.value = resultType;
    }

In the ServiceImpl class, if when I give an @Override I lose the parent class implementation, how do I get the Marshall's xml received via Soap ?. I can not understand how these classes are working together.

I hope to have been clear in the elaboration of the question, since I thank you.

    
asked by anonymous 29.10.2015 / 15:30

1 answer

1

Come on. When you give an @Override in Cancelar() you are not losing the implementation of the interface, precisely because there is none, being an interface.

What might have led you to believe this are the annotations that the interface creator put into the method parameters.

For the first question, I will translate an answer to an identical question asked in the SO. I honestly have never used anything that implements the @WebService annotation so I can only describe the technical part.

There is no need to put abstract in an interface, because it is already abstract, and adding it does not change anything.

public abstract interface Interface {
       \___.__/
           |
           '----> Não é necessário...

public void interfacing();
public abstract boolean interfacing(boolean really);
       \___.__/
           |
           '----> nem aqui.
}
  

Are there any changes in the implementation of one another?

No, exactly the same thing. The methods will continue to be implemented concretely in their child classes.

Font

Editing: One thing I forgot to comment on. The annotations of the methods are probably there for them to be handled correctly by some framework. And as they are in the interface, there will be no harm in not putting them in the impl class.

    
29.10.2015 / 18:33