khaled_jawaher -2 Junior Poster in Training

hi,i am using haxws to build webservice in java that returns an object not a primitive type.when return primitive type every thing is going well,
the error that i am receiving is:
[ERROR] javax.xml.bind.JAXBException: class endpoint.data nor any of its super class is known to this context.
org.apache.axis2.AxisFault: javax.xml.bind.JAXBException: class endpoint.data nor any of its super class is known to this context.
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:220)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:17
==========
Can you let me know if I missed anything more here.


here is the code

@WebService(name = "Calculator",targetNamespace="http://endpoint/")
//@XmlSeeAlso({endpoint.data.class})
public class Calculator {


/**
* 
* @param value1
* @param value2
* @return
* returns int
*/
@WebMethod(action = "add")
@WebResult(name="result",targetNamespace="http://endpoint/")
@RequestWrapper(localName = "addRequest",targetNamespace="http://endpoint/",className="endpoint.addRequest")
@ResponseWrapper(localName = "dataResponse",targetNamespace="http://endpoint/",className="endpoint.data")
public data add(
@WebParam(name = "value1",targetNamespace="http://endpoint/")
int value1,
@WebParam(name = "value2",targetNamespace="http://endpoint/")
int value2){
data d = new data();
d.setAttr1("test1");
d.setAttr2("test2");
d.setAttr3("test3");
return d;
}

}
==================== 
Any my data.java would be,

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "data", propOrder = {"attr1", "attr2","attr3"})
//public class data implements java.io.Serializable {
@XmlRootElement(name="dataResponse")
public class data {
//@XmlElement(name = "attr1")
@XmlElement(nillable = true)
private String attr1="testatr1";
//@XmlElement(name = "attr2")
private String attr2="testatr2";
// @XmlElement(name = "attr3")
private String attr3="testattr3";

public String getAttr1(){ return attr1; } 
public void setAttr1(String atr){ 
attr1 = atr;

}

public String getAttr2(){ return attr2;}
public void setAttr2(String atr){ 
attr2 = atr;

}
public String getAttr3(){ return attr3;}
public void setAttr3(String atr){ 
attr3 = atr;
}
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.