• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ErrorHandling in Webservice client

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<Fault xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode xmlns:ns-1671795905="http://webservice.grmf.no" xmlns="">ns-1671795905:WSException</faultcode>
<faultstring xmlns="">< ![CDATA[no.grmf.webservice.WSException]]></faultstring>
<detail xmlns="">
<WSException href="#id0" xmlns="http://webservice.grmf.no"/>
</detail>
</Fault>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns-1671795905:WSException" xmlns:ns-1671795905="http://webservice.grmf.no" xmlns="">
<errorMessage xsi:type="xsd:string">My error message</errorMessage>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>

WSException extends Exception and implements Serializable.

I have created a JAX-RPC client running this Webservice. This client receives the Exception as a com.ibm.ws.webservices.engine.WebServicesFault. Here is the information from this object:
- detail = null
- fault actor = null
- fault string = no.grmf.webservice.error.WSException
- fault code = {http://error.webservice. grmf.no}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?
 
CAUTION! Do not touch the blades on your neck propeller while they are active. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic