javaee / metro-jax-ws

https://javaee.github.io/metro-jax-ws/
Other
132 stars 68 forks source link

OUTBOUND_MESSAGE_ATTACHMENTS ignored if no user handlers #582

Open glassfishrobot opened 16 years ago

glassfishrobot commented 16 years ago

Problem: Content attached from JAX-WS client via Request Context property "javax.xml.ws.binding.attachments.outbound" is not propagated unless at least one JAX-WS Handler is present.

Description: Created a JAX-WS client from WSDL. The Web Service in question uses SOAP attachments but they are not referenced in the WSDL (i.e. not swaRef). In the client I get the Binding Request Context and set property "javax.xml.ws.binding.attachments.outbound" to a map containing a DataHandler with my content, as described in the JAX-WS specification. The attachment is not sent with the message on the wire.

If, however, I define at least one SOAPHandler in the client's handler chain, then the attachment is sent correctly, even if the handler in question does nothing.

Analysis: The class responsible for processing the attachments and including them with the message is com/sun/xml/ws/handler/ClientSOAPHandlerTube.java, method callHandlersOnRequest. However, this code path is invoked (from superclass com/sun/xml/ws/handler/HandlerTube.java) only if the handler chain is not empty. There is no reason for attachment processing to have anything to do with JAX-WS Handlers, therefore this code is incorrectly coupled.

Workaround: Ensure that at least one JAX-WS Handler is defined for the client. It can be a no-op handler that doesn't do any actual processing.

Environment

Operating System: All Platform: All

Affected Versions

[2.1.4]

glassfishrobot commented 16 years ago

Reported by rjeberhardbea@java.net

glassfishrobot commented 16 years ago

rjeberhardbea@java.net said: On reading Table 9.2 in section 9.4 of the JAX-WS 2.1 M2 spec., we now feel that this is an enhancement... That is the property is only required to be supported from a user handler; however, it's confusing that a client application can set the property from the BindingProvider and then have the property honored simply because there is a no-op user handler (and have the property ignored otherwise).

Please clarify this support so there is a consistent way to pass attachments.

glassfishrobot commented 16 years ago

Was assigned to jax-ws-issues

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA JAX_WS-582