Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-6860

JbossWS client returns null when invalid character returned in response

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • TBD EAP 5
    • EAP_EWP 5.1.0
    • Web Services
    • None
    • Hide

      This is easily reproducible on EAP 5.1.0 and EAP 5.0.1 (JBossWS Native 3.1.2) - Using Sun's WS Stack the exception is returned correctly by the client.

      Create a client that returns a String value "\uffff" - the client stub will have null. See attached file.

      Show
      This is easily reproducible on EAP 5.1.0 and EAP 5.0.1 (JBossWS Native 3.1.2) - Using Sun's WS Stack the exception is returned correctly by the client. Create a client that returns a String value "\uffff" - the client stub will have null. See attached file.
    • Workaround Exists
    • Hide

      The workaround is to add a client side handler. If the issue is with the fact that you want to differentiate between an error (invalid SOAP response) and a null (valid response) then this workaround is fine because an additional exception is thrown by the handler when trying to read the SOAP message. If it is invalid you will get the error "Cannot convert exception to fault message".

      Show
      The workaround is to add a client side handler. If the issue is with the fact that you want to differentiate between an error (invalid SOAP response) and a null (valid response) then this workaround is fine because an additional exception is thrown by the handler when trying to read the SOAP message. If it is invalid you will get the error "Cannot convert exception to fault message".
    • Medium
    • Hide
      When a JBoss Web Services (WS) client sent a response containing an invalid character, it returned null rather than raising an exception. The expected behaviour was that the client stub throw the following exception: <computeroutput>javax.xml.ws.WebServiceException</computeroutput>. The only error reported, logged to <systemitem>stderr</systemitem>, was as follows:

      <screen>
      ERROR [STDERR] [Fatal Error] :2:1462: An invalid XML character (Unicode: 0xffff) was found in the element content of the document.
      </screen>

      A system property <parameter>org.jboss.ws.IgnoreParseError</parameter> can now be set on the client side using JBossWS to allow exceptions to be propagated back to the client instead of returning <computeroutput>null</computeroutput>. If this property is not set then <computeroutput>null</computeroutput> as it was previously.
      Show
      When a JBoss Web Services (WS) client sent a response containing an invalid character, it returned null rather than raising an exception. The expected behaviour was that the client stub throw the following exception: <computeroutput>javax.xml.ws.WebServiceException</computeroutput>. The only error reported, logged to <systemitem>stderr</systemitem>, was as follows: <screen> ERROR [STDERR] [Fatal Error] :2:1462: An invalid XML character (Unicode: 0xffff) was found in the element content of the document. </screen> A system property <parameter>org.jboss.ws.IgnoreParseError</parameter> can now be set on the client side using JBossWS to allow exceptions to be propagated back to the client instead of returning <computeroutput>null</computeroutput>. If this property is not set then <computeroutput>null</computeroutput> as it was previously.
    • Documented as Resolved Issue
    • NEW

      The issue here is that when a ws client sends a response which contains an invalid character, no exception is propagated up the stack to the client and it just returns null. The expected behaviour would be that the client stub throws a javax.xml.ws.WebServiceException. The actual error is only logged to stderr.

      ERROR [STDERR] [Fatal Error] :2:1462: An invalid XML character (Unicode: 0xffff) was found in the element content of the document.

      Within org.jboss.ws.core.soap.EnvelopeBuilderDOM.java there is a boolean ignoreParseError that seems to be set to true. This means whereever an exception is caught the return value is null. Is there a specific reason for why this is done like this? What would be the suggested approach to changing this as this seems to be called in a few places but I only see it set to a hardcoded value.

        1. example.zip
          8.57 MB
        2. workaround.zip
          8.57 MB

              rdickens_jira Russell Dickenson (Inactive)
              rhn-support-mus Mustafa Musaji
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: