Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-1625

Calling SOAPPart.setContent() with a DOMSource containing an Element which is a SOAPElement the contents of the body are added twice.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jbossws-2.0.0
    • jbossws-1.2.1
    • jbossws-native
    • None

      Calling SOAPPart.setContent() with a DOMSource containing an Element which is a SOAPElement the contents of the body are added twice.

      First create a new message from an input stream of a valid message: -

      SOAPMessage newMessage = msgFact.createMessage(null, bais);

      Then create a new empty message: -

      SOAPMessage secondNewMessage = msgFact.createMessage();

      Transfer the content from the first message to the second message: -

      secondNewMessage.getSOAPPart().setContent(newMessage.getSOAPPart().getContent());

      Writing the second message results in the following: -

      secondNewMessage.writeTo(baos);

      <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:typ='http://www.jboss.org/support/phonebook/types'><soapenv:Header></soapenv:Header><soapenv:Body><typ:lookup xmlns:typ='http://www.jboss.org/support/phonebook/types'>
      <!-- This is the first name -->
      <firstName>Darran</firstName>
      <surname>Lofthouse</surname>
      </typ:lookup><typ:lookup xmlns:typ='http://www.jboss.org/support/phonebook/types'>
      <!-- This is the first name -->
      <firstName>Darran</firstName>
      <surname>Lofthouse</surname>
      </typ:lookup></soapenv:Body></soapenv:Envelope>

              darran.lofthouse@redhat.com Darran Lofthouse
              darran.lofthouse@redhat.com Darran Lofthouse
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: