Announcement Announcement Module
Collapse
No announcement yet.
create complete Soap XML from @RootElement Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • create complete Soap XML from @RootElement

    How to generate complete Soap XML from @RootElement object with spring util?

  • #2
    I have the following code but it does not generate the soap header and envelop. Any tips?

    // Create the Marshaller, so that we can generate the request SOAP Body XMl
    JAXBContext jc= JAXBContext.newInstance(PaymentCode.class);
    Marshaller m=jc.createMarshaller();
    // Creating the Request Object
    PaymentCode paymentCode=new PaymentCode();
    paymentCode.setPaymentCode(999);
    m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
    m.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);

    StringWriter wr=new StringWriter();
    // Marshalling the object to the writer
    m.marshal(paymentCode, wr);
    System.out.println(wr.toString());

    Comment

    Working...
    X