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

Provider can't send back (echo) received soap message correctly

    XMLWordPrintable

    Details

    • Workaround Description:
      Hide

      Rewrite the endpoint this way:
      public SOAPMessage invoke(SOAPMessage request)
      {
      SOAPMessage message = null;
      try

      { String str = DOMWriter.printNode(request.getSOAPPart().getEnvelope(), true); InputStream in = new ByteArrayInputStream(str.getBytes()); MessageFactory factory = MessageFactory.newInstance(); message = factory.createMessage(null, in); }

      catch (Exception e)

      { throw new RuntimeException(e); }

      return message;
      }

      IOW, re-create a new message instead of sending back the received one.

      Show
      Rewrite the endpoint this way: public SOAPMessage invoke(SOAPMessage request) { SOAPMessage message = null; try { String str = DOMWriter.printNode(request.getSOAPPart().getEnvelope(), true); InputStream in = new ByteArrayInputStream(str.getBytes()); MessageFactory factory = MessageFactory.newInstance(); message = factory.createMessage(null, in); } catch (Exception e) { throw new RuntimeException(e); } return message; } IOW, re-create a new message instead of sending back the received one.

      Description

      Invoking the org.jboss.test.ws.jaxws.samples.provider.ProviderBeanMessage endpoint (which sends back the received message instance) using tools like SOAPUi with a message like

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:prov="http://org.jboss.ws/provider">
      <soapenv:Header/>
      <soapenv:Body>
      <prov:user>
      <string>?</string>
      <qname>?</qname>
      </prov:user>
      </soapenv:Body>
      </soapenv:Envelope>

      causes a truncated message to go on the wire, even if the message is correctly logged by the MessageTrace.
      Exchanging the message above using the related testcase (org.jboss.test.ws.jaxws.samples.provider.ProviderMessageTestCase) does not reproduce the issue.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            asoldano Alessio Soldano
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: