hi,
have created
java classes from XMLs/schemas using JAXB. Am trying to marshal an instance of the generated class. Program TERMINATES.
Using WSAD. JAXB. on XP
Am sending the sysouts and the bit of code. any help would be of great use.
Thanks in advance.
Sachin.
Sysouts starts:
...
...
THE SERVICE TYPE IS : HotelSearchService
com.xxco.as.mr.sfrf.ctn.partner.common.PartnerServiceLocator : invokePartnerHotelSearchService(Object req) : ENTER
MY classname=com.xxco.as.mr.sfrf.ctn.partner.hotel.hilton.HiltonHotelSearchRequest
factory=com.xxco.ctn.sfrf.simulator.OTA_HotelSearchRQ.ObjectFactory@1c316abb
simReq=com.xxco.ctn.sfrf.simulator.OTA_HotelSearchRQ.impl.OTAHotelSearchRQImpl@ac2eabb
prePOS
postPOS
is this null=com.xxco.ctn.sfrf.simulator.OTA_HotelSearchRQ.impl.POSTypeImpl@8b12abb
Converted Request RB: com.xxco.ctn.sfrf.simulator.OTA_HotelSearchRQ.impl.OTAHotelSearchRQImpl@ac2eabb
trying to marshall
thats it! nothing more! WSAD remains stable. no spurt in memory usage. no looping seems to occur.
CODE:
...
...
if (otaHotelSearchRQ != null) {
System.out.println("Converted Request RB: " + otaHotelSearchRQ);
} else {
System.out.println(
"Null RQ Object Received At HotelSearchServiceLocator");
return null;
}
Object responseObj = null;
try {
//convert sim RQ to xml
JAXBContext jContextRQ =
JAXBContext.newInstance(
"com.xxco.ctn.sfrf.simulator.OTA_HotelSearchRQ"); //Partner RQ qualified class name
Marshaller marshaller = jContextRQ.createMarshaller();
StringWriter writer = new StringWriter();
System.out.println("trying to marshall");
marshaller.marshal(otaHotelSearchRQ, writer);
System.out.println("done marshall");
String requestXml = writer.toString();
System.out.println("Converted Request to String. making call");
//call partner service
SimulatorClient simulatorClient = new SimulatorClient();
String response = simulatorClient.processRequest(requestXml);
System.out.println("got response" + response);
//convert xml to sim RS
JAXBContext jContext =
JAXBContext.newInstance(
"com.xxco.ctn.sfrf.simulator.OTA_HotelSearchRS"); //Partner RQ qualified class name
Unmarshaller unMarshaller = jContext.createUnmarshaller();
OTAHotelSearchRS otaHotelsearchRS =
(OTAHotelSearchRS) unMarshaller.unmarshal(
new InputSource(new StringReader(response)));
if (otaHotelsearchRS == null) {
System.out.println(
"Null RS Object Received At HotelSearchServiceLocator");
}
System.out.println("Converted String to response");
//copy from sim RS to sfrf RS
responseObj = new SimHotelSearchRSBuilder().getPartnerRS(otaHotelsearchRS);
} catch (Throwable e) {
e.printStackTrace();
}
...
...