This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Services and the fly likes Exception not getting displayed in the SOAP response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Exception not getting displayed in the SOAP response" Watch "Exception not getting displayed in the SOAP response" New topic
Author

Exception not getting displayed in the SOAP response

Sat Nar
Ranch Hand

Joined: Oct 22, 2004
Posts: 83
Hi,
iam trying to throw an exception using SOAPFaultException.My requirement is that the exception should be the part of the SOAP response.But even after throwing the explicitly,iam not getting the error message in my SOAP response.Below is the code.

//Code
detail = SOAPFactory.newInstance().createDetail();
detail.addChildElement( "MyDetails" ).addTextNode( "failed" );

QName qname = new QName("Test Fault Exception");
throw new SOAPFaultException(qname,"SOAP Method failed",null,detail);

//SOAP Response

Service Response
Submitted at Tuesday, April 4, 2006 11:44:23 AM IST
<ns:ArrayOfTestVO xmlns:ns="http://www.openuri.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></ns:ArrayOfTestVO>


Kindly help me out.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
The Web Services FAQ links to 2 articles about generating and handling exceptions. Those should be a good starting point.


Ping & DNS - my free Android networking tools app
 
 
subject: Exception not getting displayed in the SOAP response