jax-ws
  1. jax-ws
  2. JAX_WS-931

Dispatch error using javax.xml.ws.Service.Mode.PAYLOAD and sending full SOAPMessage

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Per JAX-WS v2.2 section "4.3 javax.xml.ws.Dispatch"
      ================================================================================
      Dispatch supports two usage modes, identified by the constants javax.xml.ws.Service.Mode.MESSAGE
      and javax.xml.ws.Service.Mode.PAYLOAD respectively:

      Message In this mode, client applications work directly with protocol-specific message structures. E.g.,
      when used with a SOAP protocol binding, a client application would work directly with a SOAP
      message.

      Message Payload In this mode, client applications work with the payload of messages rather than the
      messages themselves. E.g., when used with a SOAP protocol binding, a client application would
      work with the contents of the SOAP Body rather than the SOAP message as a whole.

      A client does the following:
      dispatchSrc = service.createDispatch(PORT_QNAME3, Source.class, javax.xml.ws.Service.Mode.PAYLOAD);
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      And then creates a message which includes the entire soapenv:Envelope:
      msg = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><HelloRequest xmlns=\"http://helloservice.org/types"><argument>sendSource</argument></HelloRequest></soapenv:Body></soapenv:Envelope>";

      As noted above for Message Payload: "... a client application would work with the contents of the SOAP Body rather than the SOAP message as a whole".This is incorrect yet is not flagged in the RI. The RI passes for this and this seems to be incorrect according to the mode used PAYLOAD.

        Activity

        Hide
        miroslav.kos added a comment -

        If I understend it well, you expect that Dispatch mechanism wouldn't allow to send such (incorrect) message. But there no such mechanism implemented - see

        JAXWS-RI User Guide: http://jax-ws.java.net/nonav/2.2.1/docs/dispatch.html
        "Note that the Dispatch<T> instance simply acts as a conduit for the request. No validation of the message is required to be performed by the implementation, though some may catch errors during request processing. It is up to the client program to supply well-formed XML requests."

        I don't think there is any such requirement in the specification.

        Jitu, could you confirm that?

        Show
        miroslav.kos added a comment - If I understend it well, you expect that Dispatch mechanism wouldn't allow to send such (incorrect) message. But there no such mechanism implemented - see JAXWS-RI User Guide: http://jax-ws.java.net/nonav/2.2.1/docs/dispatch.html "Note that the Dispatch<T> instance simply acts as a conduit for the request. No validation of the message is required to be performed by the implementation, though some may catch errors during request processing. It is up to the client program to supply well-formed XML requests." I don't think there is any such requirement in the specification. Jitu, could you confirm that?
        Hide
        jitu added a comment -

        This is an application error. May be application is embedding a soap message as a payload in some other SOAP message. RI will not specifically look in the contents of payload. So I suggest that we close this issue.

        Show
        jitu added a comment - This is an application error. May be application is embedding a soap message as a payload in some other SOAP message. RI will not specifically look in the contents of payload. So I suggest that we close this issue.

          People

          • Assignee:
            jitu
            Reporter:
            adf59
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: