I
I
intet2014-04-09 16:13:42
Java
intet, 2014-04-09 16:13:42

How to validate a soap request (jax-ws)?

Previously, in the project, for each soap service, xsd was first written, which indicated which parameters were required when requested, which were not. Limitations on the length of arrays, patterns for string fields were set up. Java classes were generated from xsd and they were already used when requested.
Now there is a desire to abandon the generation of java classes from xsd, and directly describe the service through annotations (jax-ws ri). Mapping is done through spring.

@WebService()
public class WebService{
  @WebMethod()
  public String printMessage(@WebParam() String name) {
    return "hello "+name;
  }
}

The only thing, it is not clear how to set restrictions on the received / returned objects now.
Let's say, in the above code, process only those requests in which the name parameter starts with a capital letter, and for all the rest, issue a validation error.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
intet, 2014-04-10
@intet

Well, it looks like we will have to return to the previous scheme of work.
And so, when working through generation, it is inconvenient that any change in classes in the ide is displayed only after manual recompilation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question