I have a problem with wsgen ant task, it does not create the Student.java
model class with proper getters & setters, instead it generates JAXbElement
attributes. How do we get the original pojos out of the generated pojos?
Please see my artifacts below: 

My server appContext.xml is: 

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans"; 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
        xmlns:jee="http://www.springframework.org/schema/jee"; 
        xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
            http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-2.0.xsd";> 
        <bean id="webAnnotations" 
               
class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations" /> 
        <bean id="handlerMapping" 
               
class="org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping"> 
                <property name="typeMappingRegistry"> 
                        <ref bean="xfire.typeMappingRegistry" /> 
                </property> 
                <property name="xfire"> 
                        <ref bean="xfire" /> 
                </property> 
                <property name="webAnnotations"> 
                        <ref bean="webAnnotations" /> 
                </property> 
        </bean> 
        <!--  add your beans here --> 
        <bean id="minimizService" class="webservice.MinimizS"></bean> 
        <bean id="employeeService" class="webservice.EmployeeImpl"></bean> 
        <!--  fin  --> 
        <bean 
               
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> 
                <property name="urlMap"> 
                        <map> 
                                <entry key="/"> 
                                        <ref bean="handlerMapping" /> 
                                </entry> 
                        </map> 
                </property> 
        </bean> 
        <import resource="classpath:org/codehaus/xfire/spring/xfire.xml" /> 
</beans> 

IStudent (interface): 
/** 
 * 
 */ 
package webservice; 

/** 
 * @author TOSHIBA 
 [EMAIL PROTECTED] 
 */ 
public interface IStudent { 
        /** 
         * @author TOSHIBA 
         [EMAIL PROTECTED] 
         * 
         */ 
Student getStudent(); 
} 

StudentImpl (class): 
/** 
 * 
 */ 
package webservice; 

/** 
 * @author TOSHIBA 
 * 
 */ 
public class StudentImpl implements IStudent { 

        /* (non-Javadoc) 
         * @see webservice.IStudent#getStudent() 
         */ 
        public Student getStudent() { 
                // TODO Auto-generated method stub 
                Student student = new Student("Ahmed", new Integer(100)); 
                return student; 
        } 

} 

Student (model class): 
/** 
 * 
 */ 
package webservice; 

import org.apache.commons.lang.builder.ToStringBuilder; 
import org.apache.commons.lang.builder.ToStringStyle; 

/** 
 * @author TOSHIBA 
 * 
 */ 
public class Student { 
private String name; 
private Integer id; 
public Student(String _name, Integer _id) { 
        // TODO Auto-generated constructor stub 
        this.name= _name; 
        this.id = _id; 
} 
/** 
 * @return the id 
 */ 
public Integer getId() { 
        return id; 
} 
/** 
 * @param id the id to set 
 */ 
public void setId(Integer id) { 
        this.id = id; 
} 
/** 
 * @return the name 
 */ 
public String getName() { 
        return name; 
} 
/** 
 * @param name the name to set 
 */ 
public void setName(String name) { 
        this.name = name; 
} 
public Student() { 
        
} 
/** 
 * @see java.lang.Object#toString() 
 */ 
public String toString() { 
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) 
                        .append("name", this.name).append("id",
this.id).toString(); 
} 
} 


Client side( build.xml): 

<taskdef name="wsgen" classname="org.codehaus.xfire.gen.WsGenTask"
classpathref="master-classpath"/> 
        
<target name="gen-ws-client"> 
                <wsgen outputDirectory="${src.dir}"
wsdl="http://localhost:8080/xfire-spring/services/EmployeeService?wsdl";
overwrite="true" binding="jaxb" package="webservice.client1"/> 
        </target> 
-- 
View this message in context: 
http://www.nabble.com/How-do-we-get-the-original-pojos-using-wsgen-task--tf3147936.html#a8726680
Sent from the XFire - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to