1 Reply Latest reply on Apr 19, 2007 5:47 PM by thomas.diesler

    Strange java code generated by wsprovide

    zauberlehrling

      Hi,

      I build a webservice with the following simple pojo endpoint:

      package beispiel_1;
      
      import javax.jws.WebService;
      import javax.xml.ws.RequestWrapper;
      import javax.xml.ws.ResponseWrapper;
      
      @WebService
      public class PojoEndpoint {
      
       @RequestWrapper(className="beispiel_1.Request")
       @ResponseWrapper(className="beispiel_1.Response")
       public String sayHello(String name)
       {
       return "Hallo "+name+"!";
       }
      }

      and I generate the wsdl file with wsprovide:
      <wsprovide verbose="true"
       fork="true"
       keep="true"
       destdir="${build.dir}"
       sourcedestdir="${src.dir}"
       genwsdl="true"
       resourcedestdir="${meta.dir}/beispiel_1"
       sei="beispiel_1.PojoEndpoint">
       <classpath>
       <pathelement path="${build.dir}"/>
       </classpath>
      </wsprovide>

      I need the wsdl file for a workflow. The wsprovide task above also generates two classes Request and Response. But these java classes are not correct:

      package beispiel_1;
      
      import javax.xml.bind.annotation.XmlAccessType;
      import javax.xml.bind.annotation.XmlAccessorType;
      import javax.xml.bind.annotation.XmlElement;
      import javax.xml.bind.annotation.XmlRootElement;
      import javax.xml.bind.annotation.XmlType;
      
      @XmlRootElement(namespace = "http://beispiel_1", name = "sayHello")
      @XmlType(namespace = "http://beispiel_1", name = "sayHello")
      @XmlAccessorType(XmlAccessType.FIELD)
      public class Request {
      
       @XmlElement(namespace = "", name = "arg0")
       private String arg0;
      
       public String getArg0() {
       return this.arg0;
       }
      
       public String setArg0(String arg0) {
       this.arg0 = arg0;
       }
      
      }
      

      and
      package beispiel_1;
      
      import javax.xml.bind.annotation.XmlAccessType;
      import javax.xml.bind.annotation.XmlAccessorType;
      import javax.xml.bind.annotation.XmlElement;
      import javax.xml.bind.annotation.XmlRootElement;
      import javax.xml.bind.annotation.XmlType;
      
      @XmlRootElement(namespace = "http://beispiel_1", name = "sayHelloResponse")
      @XmlType(namespace = "http://beispiel_1", name = "sayHelloResponse")
      @XmlAccessorType(XmlAccessType.FIELD)
      public class Response {
      
       @XmlElement(namespace = "", name = "return")
       private String return;
      
       public String getReturn() {
       return this.return;
       }
      
       public String setReturn(String return) {
       this.return = return;
       }
      }

      To be more precise the return type of the set methods should be void and not String and I have problems with the variable name return.