OK Dims, here's the XML from the standard Axis 1.3 test/wsdl/faults2 (which
is a doc/lit testcase, thus relevant to my situation).
I'd say that it's substantially similar to the XML that I personally see
with my custom exceptions, and therefore I would venture to say that it's
*not* fully deserializable by a gSOAP client (because it does not correctly
indicate the embedded exception type).
<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.generalException</faultcode>
<faultstring/>
<detail>
<msg>
<a>throw</a>
<b>0</b>
<c>throw</c>
</msg>
<ns1:exceptionName
xmlns:ns1="http://xml.apache.org/axis/">test.wsdl.faults2.TestFault</ns1:exceptionName>
<ns2:hostname
xmlns:ns2="http://xml.apache.org/axis/">myhostname</ns2:hostname>
</detail>
</soapenv:Fault></soapenv:Body></soapenv:Envelope>
This is essentially what I was seeing earlier. What do you think? Thanks.
From: Davanum Srinivas <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [email protected]
Subject: Re: Exceptions are killing me
Date: Thu, 12 Jan 2006 15:06:57 -0500
Can u try to see the on the wire serialization is for test\wsdl\faults
example? in a servlet environment? last i check that was fine. it
starts from a wsdl.
You may need to switch off the hostname and stack trace stuff (see
axis.development.system in
http://ws.apache.org/axis/java/reference.html) for interop with other
stacks.
thanks,
dims
On 1/12/06, Jarmo Doc <[EMAIL PROTECTED]> wrote:
> Apologies, I attached the wrong serialization -- that one was from an
> exception that derived from Exception rather thanAxisFault (I've tried
both
> and neither works unless you happening to be talking to an Axis cleint).
>
> Here's the serialization (that's still wrong) derving from AxisFault:
>
> <soapenv:Fault
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
> <faultcode>soapenv:Server.generalException</faultcode>
> <faultstring/>
> <detail>
> <ns1:fault xmlns:ns1="mypackage">
> <ns2:mytext xmlns:ns2="mypackage">testing exceptions</ns2:mytext>
> </ns1:fault>
> <ns4:exceptionName
>
xmlns:ns4="http://xml.apache.org/axis/">mypackage.MyException</ns4:exceptionName>
> <ns5:stackTrace xmlns:ns5="http://xml.apache.org/axis/">
> ... stack trace here ...
> </ns5:stackTrace>
> <ns6:hostname
> xmlns:ns6="http://xml.apache.org/axis/">myhostname</ns6:hostname>
> </detail>
> </soapenv:Fault>
>
> Aside from 'exceptionName' which I believe is an old hack to allow Axis
> clients (and only Axis clients) to work out what type the exception is,
this
> fault does not indicate the type of the embedded exception.
>
> Should not:
>
> <ns1:fault xmlns:ns1="mypackage">
>
> instead be something like this:
>
> <ns1:fault xmlns:ns1="mypackage" type="MyException">
>
> How do I correct this behavior?
>
> >From: "Jarmo Doc" <[EMAIL PROTECTED]>
> >Reply-To: [email protected]
> >To: [email protected]
> >Subject: Exceptions are killing me
> >Date: Thu, 12 Jan 2006 11:16:15 -0800
> >
> >My Axis 1.3 server operations throw MyException which is defined
something
> >like this (though in reality it's more complex):
> >
> >public class MyException extends AxisFault implements Serializable
> >{
> > private String mytext;
> > public String getMytext() {return mytext;}
> > public void setMytext(String mytext) {this.mytext = mytext;}
> > // the normal wsdl2java generated stuff such
> > // as constructor, getSerializer(), getDeserializer()
> >}
> >
> >I see this serialized on the line as:
> >
> ><soapenv:Fault
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
> > <faultcode>soapenv:Server.userException</faultcode>
> > <faultstring>mypackage.MyException</faultstring>
> > <detail>
> > <faultData>
> > <mytext>testing exceptions</mytext>
> > </faultData>
> > <ns1:stackTrace
> > ... stack trace here ...
> > </ns1:stackTrace>
> > <ns2:hostname
> >xmlns:ns2="http://xml.apache.org/axis/">myhostname</ns2:hostname>
> > </detail>
> ></soapenv:Fault>
> >
> >I'm not an expert here, obviously, but I'm pretty sure that this
> >serialization is wrong. In particular:
> >
> >1. the fault string is the name of the exception class, which is odd
> >2. it refers to <faultData> when I'd expect to see <ns1:MyException> or
> >similar
> >3. it should not contain a server-side stack trace
> >
> >As it stands, a client that attempts to deserialize this has no clue
what
> >type the contained exception is and thus fails.
> >
> >My cubicle wall now has a large hole from me banging my head into it on
a
> >regular basis ;-) so could someone please offer a clue as to what could
be
> >going wrong. What could cause Axis to serialize my exception in this
way?
> >
> >Thanks.
>
> _________________________________________________________________
> On the road to retirement? Check out MSN Life Events for advice on how
to
> get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
>
>
--
Davanum Srinivas : http://wso2.com/blogs/
_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee®
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963