Details
Description
URL mappingFile = new URL("http://secureweb.abc.com/common/req/ABCMapping/mapping.xml");
// Load Mapping
/* Mapping mapping = new Mapping();
mapping.loadMapping(mappingFile);*/
URLConnection con = mappingFile.openConnection();
// Setting the doInput flag to true
con.setDoInput(true);
InputStream strmMapping = con.getInputStream();
InputSource srcMapping = new InputSource(strmMapping);
Mapping mapping = new Mapping();
mapping.loadMapping(srcMapping);
// initialize and configure XMLContext
XMLContext context = new XMLContext();
log.debug("the context"+context);
context.addMapping(mapping);
// Create a new Unmarshaller
Unmarshaller unmarshaller = context.createUnmarshaller();
unmarshaller.setClass(HotelShoppingResponse.class);
unmarshaller.addNamespaceToPackageMapping("http://ws.orbitz.com/schemas/2008/Common", "com.travwell.TravelEngine.translator.orbitz.data.OrbitzHotelShopping.common");
unmarshaller.addNamespaceToPackageMapping("http://ws.orbitz.com/schemas/2008/Hotel", "com.travwell.TravelEngine.translator.orbitz.data.OrbitzHotelShopping");
unmarshaller.setValidation(false);
// unmarshaller.setMapping(mapping);
// unmarshaller.setProperty("org.exolab.castor.xml.strictelements",null);
hotelShoppingResponse = (HotelShoppingResponse)unmarshaller.unmarshal(new StringReader(message));
} catch (MarshalException e)
catch (MalformedURLException e)
{ // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }Can some plz help me with this.
Thanks,
Surendra
The uncommented
seems to indicate that you are trying to change this property. Now, it is actually commented out, but setting it to 'null' would definitely be wrong.
Given that this code is commented, are you tryint to pass a custom property file to Castor and have you modified the properties included with Castor ?