Wow!!! thats a good idea and thanks a lot to Scott and rob.

By the way one more question, I'm using the custom fault handler...
But in my SOAP Client, if I use fault.getDetailEntries() its not getting all
the child elements in the vector.

For System.out.println("detail vector is..." + fault.getDetailEntries());
then my Client out put is

[[field: null], [field: null]]




Though the SOAP Wire dump is,

...
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Exception from service object: Errors occurred while processing
the message.</faultstring> <faultactor>/soap/servlet/rpcrouter</faultactor>
 <detail>
     <field>
         <name>postDt</name>
         <error>date is not correct</error>
     </field>
     <field>
         <name>acctNum</name>
         <error>acctNum is not correct</error>
     </field>
</detail> </SOAP-ENV:Fault>
...

thanks in advance...
 :o)m

-----Original Message-----
From: Robert Dietrick [mailto:rdietrick@;sega.com]
Sent: Wednesday, October 30, 2002 5:04 PM
To: [EMAIL PROTECTED]
Subject: Re: how to override code in
<faultcode>SOAP-ENV:Server</faultcode> tag


You can pass the fault code to the constructor of the SOAPException.

e.g.,

throw new SOAPException(org.apache.soap.Constants.FAULT_CODE_CLIENT,
"something went wrong");

You may want to write a custom FaultHandler, if you want to provide more
detailed information to the
client.


Omprakash Bachu wrote:
> Hi, from RPC serivce I'm trying to set custom fault code and hence will be
> available to retrieve by using fault.getFaultCode() API, but it seems that
> Apache by default sets this as SOAP-ENV:Server, can anyone help me how to
> override this code?
>
> Sample:
>
> <faultcode>SOAP-ENV:Server</faultcode>
> <faultstring>I can set custom string, this is ok</faultstring>
>
> Cheers!!!
>  Om
>
>
> --
> To unsubscribe, e-mail:   <mailto:soap-user-unsubscribe@;xml.apache.org>
> For additional commands, e-mail: <mailto:soap-user-help@;xml.apache.org>
>



--
To unsubscribe, e-mail:   <mailto:soap-user-unsubscribe@;xml.apache.org>
For additional commands, e-mail: <mailto:soap-user-help@;xml.apache.org>


--
To unsubscribe, e-mail:   <mailto:soap-user-unsubscribe@;xml.apache.org>
For additional commands, e-mail: <mailto:soap-user-help@;xml.apache.org>

Reply via email to