JAXB Marshalling supply name space for root element dynamically
- by Venkat
I have to pass the namespace for root element dynamically while marshalling using jaxb (JAXB 2.1.10 - JDK 6). i will be using the genrated xml to call different webservices which is qualified with different namespaces but same input xml.
here is my sample jaxb annotated class .....guide me with your valuable inputs.
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"taskName",
"taskType"
})
@XmlRootElement(name = "TaskRequest")
public class TaskRequest {
@XmlElement(name = "TaskName", required = true)
protected String taskName;
@XmlElement(name = "TaskType", required = true)
protected String taskType;
public String getTaskName() {
return taskName;
}
public void setTaskName(String value) {
this.taskName = value;
}
public String getTaskType() {
return taskType;
}
public void setTaskType(String value) {
this.taskType = value;
}
}