Hi cxf mailing list,

Is the absence of whitespace collapse in of the MessageID-value obtained from 
the MessageContext 
a bug or intended behavior? (See below)

Thanks in advance,
Bhun.

--

The WS-A MessageID from a message is obtainable under the 
'javax.xml.ws.addressing.context.inbound' property of the the MessageContext 
and returned as AttributedURIType.

I expected the AttributedURIType.value to comply with the schema after having 
applied the whitespace handling rules [1], but the element content is neither 
trimmed nor collapsed.

I don't have an unit test (yet), but I do have a modified version of 
distribution/src/main/release/samples/ws_addressing available, [2] with the 
following modifications
- the client is modified to send the MessageID with value  "     a  \n\n\n\nb   
b\n\n\n\n  a     "
-the service modified to print the MessageID between '|BEGIN|' and '|END|'

The server modification when run prints the MessageID sent from the client as:
{code}
|BEGIN|     a  



b   b



  a     |END|
{code}

But I would've expected the AttributedURIType.value to be returned after the 
xsd:whitespace='collapse' applied:

{code}
|BEGIN|a b b a|END|
{code}

The 'collapse' as defied in https://www.w3.org/TR/xmlschema-1/#d0e1654

{quote}
preserve
No normalization is done, the value is the ·normalized value·
replace
All occurrences of #x9 (tab), #xA (line feed) and #xD (carriage return) are 
replaced > with #x20 (space).
collapse
Subsequent to the replacements specified above under replace, contiguous 
sequences of #x20s are collapsed to a single #x20, and initial and/or final 
#x20s are deleted.
{quote}

--- 

[1] Excerpt from the schema's in the cxf-project:

{code}
 <!-- !/schemas/wsdl/ws-addr.xsd -->

<xs:element name="MessageID" type="tns:AttributedURIType"/>
<xs:complexType name="AttributedURIType">
 <xs:simpleContent>
 <xs:extension base="xs:anyURI">
 <xs:anyAttribute namespace="##other" processContents="lax"/>
 </xs:extension>
 </xs:simpleContent>
</xs:complexType>

<!-- !/schemas/wsdl/XMLSchema.xsd -->
<xs:simpleType name="anyURI" id="anyURI">
    <xs:restriction base="xs:anySimpleType">
      <xs:whiteSpace value="collapse"  fixed="true"
        id="anyURI.whiteSpace"/>
    </xs:restriction>
   </xs:simpleType>
{code}

[2] Branch with the modification of 3.4.0-SNAPSHOT master 
https://github.com/kimholan/cxf/commit/abbbafbb5887d01eb2331454abcf6ee1304e0c8f

---

Reply via email to