This works with both Axis 1.0 and 1.1, but I don't
think I control anything but fault code and fault
string. When SOAPFaultException is thrown, Axis code
catches it and you have no control at that point. Why
is the SOAP message below insufficient for you?
--- Jorge Lorenzo <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Which version of Axis are you using?.
> Your code is very similar to mine and with my
> environment the results are
> the same.
> I've called your method as:
> throwSOAPFaultException("fault code", "fault
> string");
> and Axis has generated the following SOAP fault
> message:
>
> <?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:
> fault
> string</faultstring>
> <detail/>
> </soapenv:Fault>
> </soapenv:Body>
> </soapenv:Envelope>
>
> So, I can modify only part of the faultstring. The
> rest is generated by
> Axis.
>
> Regards,
> Jorge
>
> -----Mensaje original-----
> De: Vladimir Umansky [mailto:[EMAIL PROTECTED]
> Enviado el: lunes, 10 de noviembre de 2003 18:15
> Para: [EMAIL PROTECTED]
> Asunto: Re: SOAPFaultException in Axis
>
>
> This works for me
>
> private void throwSOAPFaultException(String
> faultCode, String faultString) {
> QName qn = new QName("some qualifier",
> faultString);
> SOAPFactory fact = null;
> Detail det = null;
>
> try {
> fact = SOAPFactory.newInstance();
> det = fact.createDetail();
> } catch (javax.xml.soap.SOAPException e) {
> }
>
> throw new SOAPFaultException(qn,
> faultString,
> faultCode, det);
> }
>
>
> --- [EMAIL PROTECTED] wrote:
> > Hi,
> >
> > I've tried to throw a SOAPFaultException in the
> > handleRequest of a JAX-RPC Handler but it looks
> like
> > Axis finally generates its own exception. My code
> > is:
> >
> > Detail detail = null;
> > try {
> > detail =
> SOAPFactory.newInstance().createDetail();
> >
> detail.addChildElement("MyDetailss").addTextNode("
> > ffffailedddd");
> > } catch (SOAPException e1) {}
> > throw new SOAPFaultException(
> > new QName("http://test/test", "test"),
> > "info on the fault",
> > "info on the actor",
> > detail);
> >
> > Is it possible to work with SOAPFaultException in
> > Axis, instead of AxisFault?. How?.
> >
> > Thanks,
> > Jorge
> >
> >
>
__________________________________________________________________
> > McAfee VirusScan Online from the Netscape Network.
> > Comprehensive protection for your entire computer.
> > Get your free trial today!
> >
>
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397
> >
> > Get AOL Instant Messenger 5.1 free of charge.
> > Download Now!
> >
>
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455
>
>
> __________________________________
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
> http://antispam.yahoo.com/whatsnewfree
>
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree