IBM Support

PM18662: A JAX-WS Web service responds with a message containing illegal XML characters

Fixes are available

7.0.0.13: WebSphere Application Server V7.0 Fix Pack 13 for AIX
7.0.0.13: WebSphere Application Server V7.0 Fix Pack 13 for HP-UX
7.0.0.13: WebSphere Application Server V7.0 Fix Pack 13 for IBM i
7.0.0.13: WebSphere Application Server V7.0 Fix Pack 13 for Linux
7.0.0.13: WebSphere Application Server V7.0 Fix Pack 13 for Solaris
7.0.0.13: WebSphere Application Server V7.0 Fix Pack 13 for Windows
7.0.0.13: Java SDK 1.6 SR8FP1 Cumulative Fix for WebSphere Application Server
7.0.0.15: WebSphere Application Server V7.0 Fix Pack 15 for AIX
7.0.0.15: Java SDK 1.6 SR9 Cumulative Fix for WebSphere Application Server
7.0.0.15: WebSphere Application Server V7.0 Fix Pack 15 for HP-UX
7.0.0.15: WebSphere Application Server V7.0 Fix Pack 15 for IBM i
7.0.0.15: WebSphere Application Server V7.0 Fix Pack 15 for Linux
7.0.0.15: WebSphere Application Server V7.0 Fix Pack 15 for Solaris
7.0.0.15: WebSphere Application Server V7.0 Fix Pack 15 for Windows
7.0.0.17: WebSphere Application Server V7.0 Fix Pack 17
7.0.0.17: Java SDK 1.6 SR9 FP1 Cumulative Fix for WebSphere Application Server
7.0.0.19: WebSphere Application Server V7.0 Fix Pack 19
7.0.0.21: WebSphere Application Server V7.0 Fix Pack 21
7.0.0.23: WebSphere Application Server V7.0 Fix Pack 23
7.0.0.25: WebSphere Application Server V7.0 Fix Pack 25
7.0.0.27: WebSphere Application Server V7.0 Fix Pack 27
7.0.0.29: WebSphere Application Server V7.0 Fix Pack 29
7.0.0.31: WebSphere Application Server V7.0 Fix Pack 31
7.0.0.27: Java SDK 1.6 SR13 FP2 Cumulative Fix for WebSphere Application Server
7.0.0.33: WebSphere Application Server V7.0 Fix Pack 33
7.0.0.35: WebSphere Application Server V7.0 Fix Pack 35
7.0.0.37: WebSphere Application Server V7.0 Fix Pack 37
7.0.0.39: WebSphere Application Server V7.0 Fix Pack 39
7.0.0.41: WebSphere Application Server V7.0 Fix Pack 41
7.0.0.43: WebSphere Application Server V7.0 Fix Pack 43
7.0.0.45: WebSphere Application Server V7.0 Fix Pack 45
7.0.0.19: Java SDK 1.6 SR9 FP2 Cumulative Fix for WebSphere Application Server
7.0.0.21: Java SDK 1.6 SR9 FP2 Cumulative Fix for WebSphere
7.0.0.23: Java SDK 1.6 SR10 FP1 Cumulative Fix for WebSphere
7.0.0.25: Java SDK 1.6 SR11 Cumulative Fix for WebSphere Application Server
7.0.0.27: Java SDK 1.6 SR12 Cumulative Fix for WebSphere Application Server
7.0.0.29: Java SDK 1.6 SR13 FP2 Cumulative Fix for WebSphere Application Server
7.0.0.45: Java SDK 1.6 SR16 FP60 Cumulative Fix for WebSphere Application Server
7.0.0.31: Java SDK 1.6 SR15 Cumulative Fix for WebSphere Application Server
7.0.0.35: Java SDK 1.6 SR16 FP1 Cumulative Fix for WebSphere Application Server
7.0.0.37: Java SDK 1.6 SR16 FP3 Cumulative Fix for WebSphere Application Server
7.0.0.39: Java SDK 1.6 SR16 FP7 Cumulative Fix for WebSphere Application Server
7.0.0.41: Java SDK 1.6 SR16 FP20 Cumulative Fix for WebSphere Application Server
7.0.0.43: Java SDK 1.6 SR16 FP41 Cumulative Fix for WebSphere Application Server

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • A customer has a JAX-WS Web service that produces output
    rendered as JAXB beans.
    
    The fields within the JAXB beans are assigned data from
    another legacy application owned by the customer.  In some
    cases, the JAXB fields contain characters that are illegal xml
    characters (for example, 0x15).
    
    When the JAX-WS runtime sends a response from this Web
    service, the illegal characters are embedded within the message.
    As a result the SOAP node receiving the message will fail.
    Normally the failure will indicate a problem parsing illegal
    xml characters.
    
    This problem is preventing the customer from migrating their
    applications from the JAX-RPC programming model to the JAX-WS
    programming model.
    
    The JAX-WS engine should have a capability to strip out the
    illegal xml characters.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  IBM WebSphere Application Server V7.0 users *
    *                  of JAX-WS                                   *
    ****************************************************************
    * PROBLEM DESCRIPTION: JAX-WS Web service may respond with a   *
    *                      message containing illegal XML          *
    *                      characters.                             *
    ****************************************************************
    * RECOMMENDATION:  Install a fix pack containing this APAR and *
    *                  use the provided property.                  *
    ****************************************************************
    A customer has a JAX-WS Web service that produces output
    rendered as JAXB beans.
    
    The fields within the JAXB beans are assigned data from
    another legacy application owned by the customer.  In some
    cases, the JAXB fields contain characters that are illegal XML
    characters (0x15).
    
    When the JAX-WS runtime sends a response from this Web
    service, the illegal characters are embedded within the message.
    As a result the SOAP node receiving the message will fail.
    Normally the failure will indicate a problem parsing illegal
    XML characters.
    
    The following link defines the range of legal characters:
    http://www.w3.org/TR/2008/REC-xml-20081126/#NT-Char
    
    This problem is preventing the customer from migrating their
    applications from the JAX-RPC programming model to the JAX-WS
    programming model.
    
    The JAX-WS engine should have a capability to strip out the
    illegal XML characters.
    
    IBM will provide a property that the customer can enable to
    request filtering of illegal characters.  The property and
    usage is defined in the Problem Conclusion.
    

Problem conclusion

  • A new property is added to the JAX-WS runtime:
    
    Property Name:
    "jaxws.jaxb.write.remove.illegal.chars"
    Property Value:
    java.lang.Boolean
    Property Default:
    Boolean.FALSE (illegal characters are not removed)
    Property Location:
    The property is located on the
    javax.xml.ws.handler.MessageContext object.
    
    Description:
    A customer can set the property on the MessageContext to
    instruct the JAX-WS runtime to remove illegal characters for a
    particular web service.  Setting this property may cause a
    decrease in performance due to the extra processing necessary
    to examine and remove the illegal characters.  IBM suggests
    that this property should only be used by customers requiring
    this capability.
    
    Example 1:
    A customer may set this property within a JAX-WS handler
    that is called during server inbound processing.
    (Note that the JAX-WS will inspect both the inbound
    and outbound MessageContexts to determine if illegal
    characters should be removed during the outbound
    processing.)
    
    
    public class SampleHandler implements
    SOAPHandler<SOAPMessageContext> {
    
    ...
    public boolean handleMessage(SOAPMessageContext smc) {
    // instruct JAXWS to remove illegal characters
    // when the outbound message is written
    smc.put("jaxws.jaxb.write.remove.illegal.chars",
    Boolean.TRUE);
    }
    }
    
    
    Example 2:
    
    A customer may set this property using the
    WebServiceContext.
    
    @WebService
    public class MyWebService {
    
    @Resource
    public WebServiceContext wsc = null;
    
    @WebMethod
    public MyBeanOut myMethod(MyBeanIn in) {
    
    MessageContext mc = wsc.getMessageContext();
    // instruct JAXWS to remove illegal characters
    // when the outbound message is written
    mc.put("jaxws.jaxb.write.remove.illegal.chars",
    Boolean.TRUE);
    
    This problem is fixed in the Version 6.1 Feature Pack for Web
    Services product by APAR PM16907.
    
    The fix for this APAR is currently targeted for inclusion in
    fix pack 7.0.0.15.  Please refer to the Recommended Updates
    page for delivery information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM18662

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    700

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2010-07-17

  • Closed date

    2010-08-04

  • Last modified date

    2010-08-04

  • APAR is sysrouted FROM one or more of the following:

    PM16907

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WEBSPHERE APP S

  • Fixed component ID

    5724J0800

Applicable component levels

  • R700 PSY

       UP



Document information

More support for: WebSphere Application Server
General

Software version: 7.0

Reference #: PM18662

Modified date: 04 August 2010