I\'m using the JAXB_FRAGMENT property for my marshaller to marshal at the WorkSet level. The problem is that when I marshal it\'s giving the WorkSet element the xmlns attribute
Just another example:
try {
JAXBContext customerInformationRequestContext = JAXBContext.newInstance(CustomerInformationRequest.class);
Unmarshaller unmarshaller = customerInformationRequestContext.createUnmarshaller();
StringReader stringReader = new StringReader(requestPayload);
XMLInputFactory xif = XMLInputFactory.newFactory();
XMLStreamReader xsr = xif.createXMLStreamReader(stringReader);
XMLStreamReaderWrapper reader = new XMLStreamReaderWrapper(xsr);
CustomerInformationRequest customerInformationRequest = (CustomerInformationRequest) unmarshaller.unmarshal(reader);
CustomerInformationResponse customerInformationResponse = customerLookup(customerInformationRequest, sessionTransaction);
JAXBContext customerInformationResponseContext = JAXBContext.newInstance(CustomerInformationResponse.class);
Marshaller marshaller = customerInformationResponseContext.createMarshaller();
StringWriter stringWriter = new StringWriter();
XMLOutputFactory xof = XMLOutputFactory.newFactory();
XMLStreamWriter xsw = xof.createXMLStreamWriter(stringWriter);
xsw = new XMLStreamWriterWrapper(xsw);
marshaller.marshal(customerInformationResponse, xsw);
String responsePayload = stringWriter.toString();
return responsePayload;
} catch (Exception e) {
log.debug("The payload could not be unmarshalled.", e);
return null;
}