« Return to Thread: How to build web services with complex objects
metro-3 wrote:Hey guys
I have a problem with building a web service that returns a complex object (in my case a Java Bean). My ant-based build file always quits in the wsgen process. Having searched for tutorials and solutions to my case on the internet for a long time without success, I want to ask the experts amongst you.
Example Web Service (simplified):
@WebService
public class MyService {
@WebMethod
public MyBean getBean() {
return null;
}
}
public class MyBean {
private int value = 1;
public int getValue() { ..};
public void setValue(..) { };
}
This should be possible with JAX-WS, right? Do I have to use something special to compile this, some special annotations or something like that?
Ok, I want to build and deploy this WebService with my ANT build file, which looks similar to the following (except from my build file):
...
<target name="apt" depends="compile-server">
<taskdef name="apt" classname="com.sun.tools.ws.ant.Apt">
<classpath refid="apt.classpath"/>
</taskdef>
<echo message="Generating webservice"/>
<apt destdir="${tmp}/classes" sourcedestdir="${tmp}/src/generated" factory="util.APTFactory" sourcepath="${src}">
<classpath refid="apt.classpath" />
<source dir="${tmp}/src/service">
</source>
</apt>
</target>
<target name="wsgen" depends="apt">
<taskdef name="wsgen" classname="com.sun.tools.ws.ant.WsGen">
<classpath refid="jaxws.classpath"/>
</taskdef>
<wsgen resourcedestdir="${tmp}/webapp/WEB-INF/wsdl"
sei="${wsName}"
keep="true"
sourcedestdir="${tmp}/src/generated"
destdir="${tmp}/classes"
genwsdl="true"
verbose="true">
<classpath refid="project.classpath"/>
</wsgen>
</target>
...
When I run this build file it breaks in the wsgen command. Note that it doesn't break whenever I use simple objects, so the build-file in general must be ok.
Do you see any mistakes in it? Do you have any ideas? Or do you know where I can find a complete tutorial/article that describes how to use complex objects and describes how to use wsgen in an ANT task?
If you need a complete zipped example which fails in my environment please let me know.
Thanks a lot for your help,
Andreas
[Message sent by forum member 'a_schwarte' (a_schwarte)]
http://forums.java.net/jive/thread.jspa?messageID=354705
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net
« Return to Thread: How to build web services with complex objects
| Free embeddable forum powered by Nabble | Forum Help |