Meaningless Drivel is fun!
The moose likes Websphere and the fly likes ErrorHandling in Webservice client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "ErrorHandling in Webservice client" Watch "ErrorHandling in Webservice client" New topic

ErrorHandling in Webservice client

Jon Andr� Fagerholm

Joined: Oct 26, 2004
Posts: 2
I am working on a Web Service solution running on WebSphere 5.1. One method of this Webservice throws RemoteException and WSException. WSException is a user-defined exception.

I can see from the SOAP-response(using XML-spy) that the exception is presented in the detail-field in the Fault-object.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="" xmlns:soapenc="" xmlns:xsd="" xmlns:xsi="">
<Fault xmlns="">
<faultcode xmlns:ns-1671795905="" xmlns="">ns-1671795905:WSException</faultcode>
<faultstring xmlns="">< ![CDATA[no.grmf.webservice.WSException]]></faultstring>
<detail xmlns="">
<WSException href="#id0" xmlns=""/>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="" xsi:type="ns-1671795905:WSException" xmlns:ns-1671795905="" xmlns="">
<errorMessage xsi:type="xsd:string">My error message</errorMessage>

WSException extends Exception and implements Serializable.

I have created a JAX-RPC client running this Webservice. This client receives the Exception as a Here is the information from this object:
- detail = null
- fault actor = null
- fault string = no.grmf.webservice.error.WSException
- fault code = {http://error.webservice.}WSException
- fault details = [Lorg.w3c.dom.Element;@da6bf4

My problem is that I don�t find a way to get the WSException and read the ErrorMessage.
Is it possible to retrieve this Exception and the ErrorMessage, and if so, how do I do so?
I agree. Here's the link:
subject: ErrorHandling in Webservice client
jQuery in Action, 3rd edition