[jboss-user] [JBossWS] - Strange java code generated by wsprovide
zauberlehrling
do-not-reply at jboss.com
Mon Apr 9 11:20:21 EDT 2007
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.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035737#4035737
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035737
More information about the jboss-user
mailing list