Hi
I use AXIOM style client code to invoke service. My service is
implemented using generated stub. It uses policy for security. To test
the fault handling, my server code always throws AxisFault.
If the client code has this line:
"options.setSoapVersionURI(org.apache.axiom.soap.SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);",
the AxisFault is reported back correctly to client. The response is like
this
--------------------
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: application/soap+xml;
action="http://www.w3.org/2005/08/addressing/soap/fault";charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 23 Oct 2008 04:29:32 GMT
Connection: close
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><soapenv:Fault
xmlns:axis2ns5="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Code><soapenv:Value>axis2ns5:Server</soapenv:Value></soapenv:Code>
de
<soapenv:Reason><soapenv:Text xml:lang="en-US">error
...</soapenv:Text></soapenv:Reason>
--------------------------
If the client code does not have that line, the message is sent to
server using SOAP 11 style,
The response is a HTTP error from tomcat.
---------------------
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Length: 1000
Date: Thu, 23 Oct 2008 04:30:06 GMT
Connection: close
<html><head><title>Apache Tomcat/6.0.16 - Error
report</title><style>...</style> </head><body><h1>HTTP Status 500 -
</h1><HR size="1" noshade="noshade"><p><b>type</b> Status
report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The
server encountered an internal error () that prevented it from
fulfilling this request.</u></p><HR size="1"
noshade="noshade"><h3>Apache Tomcat/6.0.16</h3></body></html>
----------------------------
I traced the error to
org.apache.axiom.soap.impl.builder.SOAP11BuilderHelper line 151
private void processText(XMLStreamReader parser, OMElement value) {
try {
146 int token = parser.next();
147 while (token != XMLStreamReader.END_ELEMENT) {
148 if (token == XMLStreamReader.CHARACTERS) {
149 factory.createOMText(value, parser.getText());
150 } else {
151 throw new SOAPProcessingException(
"Only Characters are allowed here");
}
token = parser.next();
}
} catch (XMLStreamException e) {
throw new SOAPProcessingException(e);
}
}
When the error occurs, the value is an
org.apache.axiom.soap.impl.dom.soap11.SOAP11FaultCodeImpl element. token
is 1(StartElement).
Is this a bug or something wrong in my code?
thanks
-jason
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]