axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Junaid.Bha...@mro.com
Subject RE: exceptiong handling
Date Mon, 21 Jun 2004 15:03:02 GMT
                                                                            
 In your server-config.wsdd file, set the axis.development.system global    
 config parameter to false.                                                 
 false = production system, stack traces not sent out in the SOAP messages  
 true = development system, stack traces sent out                           
                                                                            
 <globalConfiguration>                                                      
     <parameter name="axis.development.system" value="false"/>              
     ....                                                                   
     ....                                                                   
 </globalConfiguration>                                                     
                                                                            
                                                                            
 As for your exception information not getting serialized within the        
 <detail> section of the soap fault, have you tried specifying the <fault>  
 parameter within the                                                       
 <operation> section of your deploy.wsdd when you deployed your web         
 service? Have a look at deploy.wsdd in the samples\faults folder for an    
 example.                                                                   
                                                                            
  - Junaid                                                                  
                                                                            






                                                                           
             Vikas Phonsa                                                  
             <VPhonsa@suz.com>                                             
                                                                        To 
             06/18/2004 04:36          "'axis-user@ws.apache.org'"         
             PM                        <axis-user@ws.apache.org>           
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
             axis-user@ws.apac         RE: exceptiong handling             
                  he.org                                                   
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




I pulled out the source code for samples/faults from the apache axis cvs
and
tried to implement and test the web service.

Same thing, I get the stack trace back in the SOAP message. The SOAP
message
should just have the fault string like "no employee found". I don't want
the
entire big stack trace to come back to the client. And let me mention that
I'm trying to run the webservice using axis under websphere v5.0. Exactly
same thing happens even if I don't use axis.

I'm enclosing excerpts from the wsdl generated for the code:

             <wsdl:message name="NoSuchEmployeeFault">
                   <wsdl:part name="fault"
type="intf:NoSuchEmployeeFault"/>
              </wsdl:message>

<wsdl:operation name="getEmployee" parameterOrder="id">
  <wsdl:input message="intf:getEmployeeRequest" name="getEmployeeRequest"/>
<wsdl:output message="intf:getEmployeeResponse"
name="getEmployeeResponse"/>
 <wsdl:fault message="intf:NoSuchEmployeeFault"
name="NoSuchEmployeeFault"/>
 </wsdl:operation>


Vikas



-----Original Message-----
From: Davanum Srinivas [mailto:davanum@gmail.com]
Sent: Friday, June 18, 2004 9:28 AM
To: axis-user@ws.apache.org
Subject: Re: exceptiong handling

see samples/fault


----- Original Message -----
From: Vikas Phonsa <vphonsa@suz.com>
Date: Fri, 18 Jun 2004 08:44:48 -0700
Subject: RE: exceptiong handling
To: "axis-user@ws.apache.org" <axis-user@ws.apache.org>





















Thanks for your reply.







But shouldn't an application be
allowed to throw any kind of custom exceptions not tied to Axis Fault ?







And I would appreciate if someone can give
a concrete working example of a web service class actually throwing an
exception (extended from Axis fault or whatever). And also the wsdl for
that
web service.







Thanks



Vikas







-----Original Message-----

From: Dhanush Gopinath
[mailto:dhanush@mahindrabt.com]

Sent: Thursday, June 17, 2004
10:27 PM

To: axis-user@ws.apache.org

Subject: Re: exceptiong handling










Vikas,

















I
doubt that your excpetion class should extend AxisFault. But I am not sure
about it , just have a hunch .

















Cheers









Dhanush










----- Original Message -----








From: Vikas Phonsa








To: 'axis-user@ws.apache.org'









Sent: Friday,
June 18, 2004 1:35 AM








Subject: FW:
exceptiong handling


















Hi



This is not an axis specific issue
but I would appreciate any help.







I am using axis and am
trying to implement exception handling functionality for my web
service but I'm running into an
issue.







My Exception class is:



----------------------------------------------------------------------------




public class WebException extends Exception{





private
String message;




public
WebException(String message){





this.message = message;
}








public
String getMessage() {




return
this.message;




}






}









And my web services implementation
class is:












public class ComSuzSiebelWebService {









private
ComSuzSiebelWebServicesBean
bean = null;









public
void
setBean(ComSuzSiebelWebServicesBean
bean) throws
Exception, WebException {




this.bean = bean;




if
(bean.getAccountLocation()
!= "b"){




WebException e = new WebException("wrong value entered for account
location");




throw
e;



}




}
















}










And in the wsdl I defined the fault
as:







<wsdl:message name="WebException">



   <part name="message" type="xsd:string"/>



 </wsdl:message>



<wsdl:portType>



<wsdl:operation name="setBean" parameterOrder="bean">



         <wsdl:input message="intf:setBeanRequest" name="setBeanRequest"/>



         <wsdl:output message="intf:setBeanResponse"
name="setBeanResponse"/>



         <wsdl:fault name="fault" message="intf:WebException"/>



      </wsdl:operation>



   </wsdl:portType>











But in the SOAP response message
that I get back I'm getting the whole stack trace back











-
<soapenv:Fault>




<faultcode
xmlns:ns1="http://xml.apache.org/axis/
">ns1:Server.userException</faultcode>




<faultstring>



com.suz.siebel.webservice.WebException: wrong
value entered for account location



</faultstring>




<detail>




<ns2:stackTrace xmlns:ns2="http://xml.apache.org/axis/">



com.suz.siebel.webservice.WebException: wrong
value entered for account location at
com.suz.siebel.webservice.ComSuzSiebelWebService.setBean(ComSuzSiebelWebServ

ice.java:37)
at java.lang.reflect.Method.invoke(Native Method) at
org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:372

)
at



-----------------------




</ns2:stackTrace>




</detail>



        </soapenv:Fault>























My idea behind throwing the
exception was to communicate back to the client that he has sent a
wrong value for
the "accountLocation" field of the bean that is sent to the setBean
method. I don't want the whole stack trace to be sent back to the Client.







Could you pls tell what am I doing
wrong or if I am taking the wrong approach here.







Thanks in advance.







Vikas Phonsa


















*********************************************************
Disclaimer:


This message (including any attachments) contains

confidential information intended for a specific

individual and purpose, and is protected by law.

If you are not the intended recipient, you should

delete this message and are hereby notified that

any disclosure, copying, or distribution of this
message, or the taking of any action based on it,

is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com




--
Davanum Srinivas - http://webservices.apache.org/~dims/



Mime
View raw message