Skip to content

Instantly share code, notes, and snippets.

@kartikshah
Created February 1, 2012 20:33
Show Gist options
  • Save kartikshah/1719145 to your computer and use it in GitHub Desktop.
Save kartikshah/1719145 to your computer and use it in GitHub Desktop.
Jaxb Unmarshal at WSDL input parameter level
public class JaxbUnmarshallerMethodInput{
public static void main(String args[]){
try{
JAXBContext jc = JAXBContext.newInstance("com.kartikshah.api.account.wsdl");
Unmarshaller u = jc.createUnmarshaller();
JAXBElement element = (JAXBElement)u.unmarshal(JaxbUnmarshallerMethodInput.class.getResource("query.xml"));
MethodInput methodInput = (MethodInput)element.getValue();
Account account = methodInput.getAccount();
ServiceContext context = methodInput.getServiceContext();
}
catch (Exception e){
// Removed for brevity
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment