JDK-8183528 : SOAP payload with empty default namespace (xmlns="") sent to WS is null in SOAP implementation
  • Type: Bug
  • Component: xml
  • Sub-Component: jax-ws
  • Affected Version: 8u131
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2017-06-28
  • Updated: 2017-07-04
  • Resolved: 2017-07-04
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
WIndows 7 Professional x64  SP1

A DESCRIPTION OF THE PROBLEM :
SOAP payload that resets the default namespace will be ignored and end up as empty/null in SOAP service implementation.  Example message:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
   <soapenv:Header/>
   <soapenv:Body>
      <transcode xmlns="http://snellwilcox.com/xmlbinding/icr/2007/04/control">
         <arg0 xmlns="">Content</arg0>
      </transcode>
   </soapenv:Body>
</soapenv:Envelope>

The string "Content" will never make it to the service.  In the following example the parameter value will always be null/empty:

public String transcode(String content) {
...
}

This is believed to be the same issue as http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8159058 but it does not appear to be fixed as claimed in JRE 8u131.

REGRESSION.  Last worked in version 7u76

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a SOAP request as described.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
"Content" should be passed to the SOAP implementation.
ACTUAL -
Parameter is null/empty

ERROR MESSAGES/STACK TRACES THAT OCCUR :
No error

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
SOAP XML can use namespace prefixes throughout but it is not possible for us to force this on customers.


Comments
JDK-8159058 has been fixed for JDK 9 and the backport will be available in the upcoming JDK releases. It is also available in the early access update of JDK 8 (JDK8u152) at http://jdk.java.net/8/ .
04-07-2017