You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Rumpa Giri <rg...@dentalxchange.com> on 2003/05/23 18:49:15 UTC

new user question : SOAPFaultException vs. AxisFault

Problem : Want to generate faults with control over what goes into the tag.
The webservice implemented is RPC style.

Solution tried :

If I create an AxisFault the mapping to the fault tags are very neat. 
This was generated if I throw the AxisFault.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <soapenv:Fault>
   <faultcode>soapenv:soapenv:Server.userException</faultcode>
   <faultstring>Unauthorised access.</faultstring>
   <faultactor></faultactor>
   <detail>
    <string>Failed to login.</string>
   </detail>
  </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>


But if I create SOAPFaultException providing the same faultcode,
faultstring, detail and throw,
it does not map to outgoing response fault envelope properly. Is there a way
to do that? What I got was as follows:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <soapenv:Fault>
   <faultcode>soapenv:Server.userException</faultcode>
   <faultstring>javax.xml.rpc.soap.SOAPFaultException: Unauthorised
access.</faultstring>
   <detail/>
  </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>

or is there a better way to indicate the faults.

Thanks,
Rumpa 
 
This transmission may be confidential or protected from disclosure and is
only for review and use by the intended recipient. Access by anyone else is
unauthorized. Any unauthorized reader is hereby notified that any review,
use, dissemination, disclosure or copying of this information, or any act or
omission taken in reliance on it, is prohibited and may be unlawful. If you
received this transmission in error, please notify the sender immediately.
Thank you.