Translate

15 Haziran 2020 Pazartesi



private void requestMarshall(CreateOrderRequest request){
   try {
      JAXBContext jaxbContext = JAXBContext.newInstance(CreateOrderRequest.class);
      Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
      StringWriter stringWriter = new StringWriter();
      jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
      QName qName = new QName("http://deneme//EmployeeTypes", "CreateOrderRequest");
      JAXBElement<CreateOrderRequest> root = new JAXBElement<CreateOrderRequest>(qName, CreateOrderRequest.class, request);
      jaxbMarshaller.marshal(root, stringWriter);
      String result = stringWriter.toString();
      getLogger().warn("Create order request XML: {}" ,result);
   }catch (JAXBException jb){
      getLogger().error("Create order request XML marshall error: {}" ,jb);
   }
}

When we have something like this in our Request object 

typeDesc.setXmlType(new QName("http://deneme/ManagementTypes", ">CreateOrderRequest"));

Hiç yorum yok:

Yorum Gönder

Bu Blogda Ara