Hi,

i wanted to control the WSDL from a JAXWS webservice endpoint and used a
ResponseWrapper in order to do that.
I didn't like the generated WSDL since it used a wrapping "return" element
for the type of the wsdl:part for the response
and wanted to get rid of it.
The response element looked like this:
<response>
   <return>
      <message></message>
    </return>
</reponse>

All i want is a more "direct" type for the reponse without the <return>
element.
I thought about using a ResponseWrapper and created one:

@ResponseWrapper(className="test.ResponseWrapper")
Response generateResponse()

The generated WSDL looks fine since the type defined in the ResponseWrapper
is used directly (no more
wrapping element).

Here's the content of the ReponseWrapper:
package test;

@XmlRootElement
@XmlType(propOrder = {"message"})
@XmlAccessorType(XmlAccessType.FIELD)
public class ResponseWrapper {
     @XmlElement(name="message")
    private String message;
    public String getMessage() {
         return message;
    }

   public void setMessage(String aMessage) {
       message=aMessage;
   }

   public void setResponse(Response response) {
           this.message=response.getMessage();
   }

  public Response getResponse() {
        return new Response(message);
  }

}

But when i invoke the webservice i never see the <message> element. The
field does not appear in the response.
Maybe i don't understand the usage of the ResponseWrapper and haven't found
much information on it .
I added a breakpoint in the setResponse method but it's never reached.

Thanks in advance,
Luc

Reply via email to