aspose file tools*
The moose likes XML and Related Technologies and the fly likes javax.xml.bind.UnmarshalException: unexpected element (uri: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "javax.xml.bind.UnmarshalException: unexpected element (uri:"http://ERP-EPIC.att.com/processSalesOrde" Watch "javax.xml.bind.UnmarshalException: unexpected element (uri:"http://ERP-EPIC.att.com/processSalesOrde" New topic
Author

javax.xml.bind.UnmarshalException: unexpected element (uri:"http://ERP-EPIC.att.com/processSalesOrde

Suresh Sudineni
Greenhorn

Joined: Jul 18, 2008
Posts: 3
Hi,

i have generated javaclasses from XSD through JAXB. and now i want to convet my Xml to JAXB to do the xml validations.

can anyone send me the solution for below Exception

javax.xml.bind.UnmarshalException: unexpected element (uri:"http://ERP-EPIC.att.com/processSalesOrder", local:"orderRequest"). Expected elements are <{http://ERP-EPIC.att.com/commonData}WSCallback>,<{http://ERP-EPIC.att.com/commonData}WSContext>,<{http://cio.att.com/commonheader/v3}WSConversationId>,<{http://cio.att.com/commonheader/v3}WSCorrelationId>,<{http://ERP-EPIC.att.com/commonData}WSEndUserToken>,<{http://ERP-EPIC.att.com/commonData}WSEnterpriseLogging>,<{http://ERP-EPIC.att.com/commonData}WSException>,<{http://ERP-EPIC.att.com/commonData}WSHeader>,<{http://ERP-EPIC.att.com/commonData}WSMessageData>,<{http://ERP-EPIC.att.com/commonData}WSResponseHeader>,<{http://cio.att.com/commonheader/v3}WSResponseMessageExpiration>,<{http://ERP-EPIC.att.com/processSalesOrder}deliveryAcknowledgement>,<{http://ERP-EPIC.att.com/modifyEquipmentStatus}modifyEquipmentStatusResponse>
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(Unknown Source)

i am using below code

JAXBContext jc1 = JAXBContext.newInstance("com.att.erp_epic.commondata");
System.out.println("jc1---------"+jc1);
Unmarshaller unmarshal = jc1.createUnmarshaller();
System.out.println("unmarshal---------"+unmarshal);
Object output = unmarshal.unmarshal(new StreamSource(new StringReader(xmlMessage)));
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: javax.xml.bind.UnmarshalException: unexpected element (uri:"http://ERP-EPIC.att.com/processSalesOrde