Hello,
MyException is declared correctly, i think. Here's the WSDL segment.
<complexType name="MyException">
<sequence>
<element name="clave" nillable="true" type="xsd:string"/>
<element name="localizedMessage" nillable="true" type="xsd:string"/>
</sequence>
</complexType>......
<wsdl:fault name="MyException">
<wsdlsoap:fault use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="someUri"/>
</wsdl:fault>
Yes, I guess I am using Axis the normal way. Interface -->WSDL-->stubs and skeletons.
I am using axis both for publishing the service and for calling it from the stub client.
However, I am getting rid of the classes generated from the types in WSDL.
Why? Because I already have them. They are the same classes I have on the server, including
MyException. Sure, I could use MyException generated by Axis, but, why, having the original MyException class?
My goal is to make the stub client throw instances of MyException (my implementation of MyException)
transparently, not letting the ones using the stub provided by Axis know anything else.
A different thing is Axis not supporting what i need, say, making me subclass AxisFault, which I stated I'll try to avoid.
However, if everything else fails, well....
Thanks again Sunil.
Mariano.
Sunil Kothari wrote:
Let me elaborate further. I think if your exception structure is declared correctly in WSDL then the framework comes into picture only when you generate java/.NET server/client code from it.
When I say subclass AxisFault I assume that you go the normal way of generating a java interface ---> WSDL ---> stubs and skeletons.
and you use only Axis all the way.
I think its your "framework" which has to generate correct code based on WSDL. When I say subclass AxisFault I mean if you use Axis then that's the way.
If you want to get hold of XML and use a handler then I think that should work too.
Sunil Kothari
----- Original Message -----
From: Mariano Eloy Fern�ndez <[EMAIL PROTECTED]>
Date: Wednesday, February 23, 2005 2:14 pm
Subject: Re: How do I deserialize the detail field in AxisFault to build MyException?
Hello,
Thanks Sunil, I have already seen people subclassing AxisFault, but I refuse doing such a thing.
MyException is a "ServiceException", and should know anything about being published with Axis.
Imagine just tomorrow I decide to move onto some other framework to publish/call Web Services.
Then what, should I subclass some other different FrameworkFault? Of course not.
My idea is to get grip of that XML provided in the AxisFault on the client Stub, unwrap MyException and throw it,
so that the stub throws true MyException instances (or RemoteExceptions, if some ConnectRefused-like occurs)
In all, I�ll keep on trying, and thanks a lot for your comment.
Mariano.
Sunil Kothari wrote:
No, you don't have to do it manually. Just make sure that yourWSDL
correctly reflects the structure of MyException. I found thatjava2wsdl
tool somehow misses the structure of application-specificexceptions.
To get hold of the exception use try-catch mechanism. Note that MyException should subclass AxisFault.you a
If you still have problems then let me know so that I can send
tosample code.
I hope that helps.
Sunil Kothari
----- Original Message -----
From: Mariano Eloy Fern�ndez <[EMAIL PROTECTED]>
Date: Wednesday, February 23, 2005 1:45 pm
Subject: Re: How do I deserialize the detail field in AxisFault
build MyException?
Hi,
Some additional notes.
The XML comes in a protected attrbute called faultDetails, inaccesible.The public detail field is null.
The question stands, How do I build MyException from this AxisFault?
Thanks,
Mariano.
Mariano Eloy Fern�ndez wrote:
XML inHello,
I am working with Axis 1.1
I have a class MyException extends Exception thrown in the Web Service. Both De/Serializer are provided for MyException.
An AxisFault is received in the client with MyException as an
the detail field of AxisFault.manually?
How do I build MyException from that XML? Do I have to do it
Then what's the MyExceptionDe/Serializer for?
Thanks,
Mariano Eloy Fern�ndez.
