Hi,
I'm trying to find a way to throw my own exception when
an XML parser error occurs.
I couldn't find anything related in the list, although I
remember reading about it.
An example with my calculator web-service:
Request:
---------------------------------------------------------
<soapenv:Envelope ....>
<soapenv:Body>
<cal:multiply>
<cal:mult1>12</cal:mult1>
<!-- ERROR: none closing > -->
<cal:mult1 233.83839</cal:mult2>
<cal:decimals>-1</cal:decimals>
</cal:multiply>
</soapenv:Body>
</soapenv:Envelope>
---------------------------------------------------------
Response:
---------------------------------------------------------
<soap:Envelope....>
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Couldn't parse stream.. Nested exception is
com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character
'2' (code 50) (expected a name start character)
at [row,col {unknown-source}]: [5,20]</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
---------------------------------------------------------
I want the response to look something like this (of course I will
configure the detail data):
---------------------------------------------------------
<soap:Envelope....>
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Couldn't parse stream.. Nested exception is
com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character
'2' (code 50) (expected a name start character)
at [row,col {unknown-source}]: [5,20]</faultstring>
<detail>
<MyFault xmlns="http://faults.ws.intellisoa.com">
<date>2007-07-21T17:18:53.954-03:00</date>
<errorCode>REQUEST_FORMAT_ERROR</errorCode>
<errorId>-1001</errorId>
<description>Couldn't parse stream.. Nested exception is
com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character
'2' (code 50) (expected a name start character)
at [row,col {unknown-source}]: [5,20]</description>
</MyFault>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
---------------------------------------------------------
Is there a way to do this ?
thank you in advance
tonio
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email