I am new to web service development, i have been trying to develop a sample web service, but i see a problem in returning the custom data type from the web service.
complete details below:
my SEI is as below
@SOAPBinding(style = Style.DOCUMENT)
public interface StudentService
* Fetches the student object based on the student ID passed as parameter
* @param id the student ID
* @return the student object.
Student getStudent(String id) throws StudentException;
my SIB is as below:
@WebService(endpointInterface = "com.jj.student.StudentService")
public class StudentServiceImpl implements StudentService
public Student getStudent(String id) throws StudentException
// mock content for time being.
Student student = new Student("student01", new Name("first name",
"middle name", "last name"), 21, new Address());
I used wsgen to generate the WSDL, the problem i could see is the schema generated along with the wsdl doesnt seem to consider the class members of Stuent.java!
<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.7-b01-. --><xs:schema xmlns:tns="http://student.jj.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://student.jj.com/">
if you observe, the student type has an empty sequence though i have class members for student!
I dont know where am i going wrong? why is it not generating the schema properly?
Thanks in advance
Joined: Jul 21, 2008
okay, i have found the problem... its just that my custom data type which is the student class did'nt follow the bean standards (a default constructor and setter methods) but wsgen didnt flag any error about this..
I don't know if it helps, but have you used the verbose flag with wsgen?
Perhaps there are some warnings or hints regarding your Student class not following Java bean standard given when it is turned on?