Empty namespace causes INVALID_CHARACTER_ERR Exception
------------------------------------------------------

                 Key: AXIS2-2718
                 URL: https://issues.apache.org/jira/browse/AXIS2-2718
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: client-api
    Affects Versions: 1.2
         Environment: Windows XP, IBM JDK
            Reporter: Vasyl Zhabko


Server implementation is .NET, SOAP protocol 1.1. Response sent is (actual 
server response):

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length:


<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
  <soap:Body>
    <Insert xmlns="https://localhost";>
      <InsertResult>int</InsertResult>
      <ResponseMsg>string</ResponseMsg>
      <ResponseText>string</ResponseText>
    </Insert>
  </soap:Body>
</soap:Envelope>

Two issues here:  

First:  Document header (<?xml version="1.0" encoding="utf-8"?>) raises 
exception:

Caused by: javax.xml.soap.SOAPException: com.ctc.wstx.exc.WstxParsingException: 
Illegal processing instruction target ("xml"); xml (case insensitive) is 
reserved by the specs.
 at [row,col {unknown-source}]: [2,5]
        at 
org.apache.axis2.saaj.SOAPConnectionImpl.handleSOAPMessage(SOAPConnectionImpl.java:154)
        at 
org.apache.axis2.saaj.SOAPConnectionImpl.call(SOAPConnectionImpl.java:117)

Second: Remove header from response: Exception raised is:

Caused by: org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or 
illegal XML character is specified. 
        at 
org.apache.axiom.om.impl.dom.DocumentImpl.checkQName(DocumentImpl.java:460)
        at 
org.apache.axiom.om.impl.dom.DocumentImpl.createElementNS(DocumentImpl.java:200)
        at 
org.apache.axis2.saaj.SOAPBodyImpl.addChildElement(SOAPBodyImpl.java:141)
        at 
org.apache.axis2.saaj.SOAPConnectionImpl.toSAAJElement(SOAPConnectionImpl.java:261)
        at 
org.apache.axis2.saaj.SOAPConnectionImpl.getSOAPMessage(SOAPConnectionImpl.java:204)
        at 
org.apache.axis2.saaj.SOAPConnectionImpl.handleSOAPMessage(SOAPConnectionImpl.java:152)
        at 
org.apache.axis2.saaj.SOAPConnectionImpl.call(SOAPConnectionImpl.java:117)

Fix: build response like this (that I cannot do in production environment) :

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length:


<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
  <soap:Body>
    <a:Insert xmlns:a="https://localhost";>
      <a:InsertResult>int</a:InsertResult>
      <a:ResponseMsg>string</a:ResponseMsg>
      <a:ResponseText>string</a:ResponseText>
    </a:Insert>
  </soap:Body>
</soap:Envelope>


Everything starts working OK.

I have no control over server responses. I have responded to Axis with custom 
HTTP daemon.
Similar problem exists when we are building soap request messages by providing 
XML inside input stream (XSLT generated content).




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to