Results 1 to 2 of 2

Thread: create complete Soap XML from @RootElement

  1. #1

    Default create complete Soap XML from @RootElement

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

  2. #2

    Default

    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());

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •