Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7240

JAX-WS Dispatch incorrectly asserts that Message mode with XML/HTTP binding is invalid when using instances of DataSource

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1.7, 3.1.10
    • 3.0.13, 3.1.11, 3.2.0
    • JAX-WS Runtime
    • None
    • Moderate

    Description

      If a instance of dispatch is created in the following way:

          QName serviceName = new QName("http://org.apache.cxf", "stockQuoteReporter");
          Service s = Service.create(serviceName);
       
          QName portName = new QName("http://org.apache.cxf", "stockQuoteReporterPort");
          Dispatch<ByteDataSource> dispatch = s.createDispatch(portName,
                                                               ByteDataSource.class,
                                                               Service.Mode.MESSAGE);}}
      

      then invoking the created Dispatch instance like so:

          dispatch.invoke(new ByteDataSource("".getBytes()));
      

      results in an exception with the message "DataSource is not valid in MESSAGE mode with XML/HTTP binding."

      This contradicts your own documentation(and I believe the JAX-WS spec) in that these are this the only binding and mode you can use in combination with a DataSource :

      Dispatch objects can use objects that implement the javax.activation.DataSource interface when the following conditions are true:

      the Dispatch object is using the HTTP binding.
      the Dispatch object is using message mode.

      Attachments

        Activity

          People

            ffang Freeman Yue Fang
            sourcesmith Liam H
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: