axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Green" <david.gr...@maketechnologies.com>
Subject RE: exception and SOAP fault
Date Thu, 01 May 2003 20:31:35 GMT
Tom,

That's good news!  Thanks for the heads-up.

David

-----Original Message-----
From: Tom Jordahl [mailto:tomj@macromedia.com]
Sent: Thursday, May 01, 2003 12:44 PM
To: 'axis-dev@ws.apache.org'
Subject: RE: exception and SOAP fault


Hi David and Dan,

Please note, the <exceptionName> element is an obsolete hack that I put in to get the
same exception class to be created on the client as was thrown on the server.  The 1.1 code
base keeps sending this element to allow Axis 1.0 clients to continue to work in the same
(broken) fashion.  I believe it is used as a fallback on the client, if present.  It probably
should not be.

For 1.1, the exceptions in the client are registered in a map, which maps QNames to Java classes.
 See the emitted client stubs for API usage.  When Axis gets an exception, it examines the
details for QNames, and looks them up in the map.  If it finds one, it hands the class name
and the element to the Bean deserializer, which then proceeds to create the exception class
and populate the data.

DO NOT create any code that depends on this exceptionName element.  There is no way that this
will be interoperable.  In particular, many people have different package/class names for
their exceptions on the client and server.

This is why this element is in an Apache axis namespace.

--
Tom Jordahl
Macromedia Server Development

-----Original Message-----
From: David Green [mailto:david.green@maketechnologies.com] 
Sent: Thursday, May 01, 2003 3:36 PM
To: axis-dev@ws.apache.org
Subject: RE: exception and SOAP fault

Dan,

Glad that the patch works!

What I mean when I said that the exception type is in the Axis namespace is shown in the following
fault example.  Notice the <ns1:exceptionName> element, which is namespaced to axis.
 Is this what your patch (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18084) applies
to?

In my opinion, any client (inlcuding Axis clients) should be able to figure out the exception
type from the WSDL (ie: the generated code should automatically map the fault type to a generated
exception class.)  This would make Axis clients truly interoperable.

<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>com.maketechnologies.webservice.test.BusinessException: Parameter evp
is required, but missing. (ref# 7)</faultstring>
   <detail>
    <faultData href="#id0"/>
    <ns1:exceptionName xmlns:ns1="http://xml.apache.org/axis/">com.maketechnologies.webservice.test.BusinessException</ns1:exceptionName>
   </detail>
  </soapenv:Fault>
  <multiRef id="id0" soapenc:root="0" 
	soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
	xsi:type="ns2:BusinessException" 
	xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
	xmlns:ns2="http://test.webservice.maketechnologies.com">
   <errorCode xsi:type="xsd:int">7</errorCode>
   <message xsi:type="xsd:string">Parameter evp is required, but missing. (ref# 7)</message>
  </multiRef>
 </soapenv:Body>
</soapenv:Envelope>



-----Original Message-----
From: Dan Diephouse [mailto:dan@envoisolutions.com]
Sent: Thursday, May 01, 2003 4:49 PM
To: axis-dev@xml.apache.org
Subject: Re: exception and SOAP fault


Hi David (and everyone else too),

Thanks for the great patch! I was actually just about to look into this 
issue today when I started scanning the axis list again and found your 
message.  I've been travelling for the past month so I've missed a few 
things....

Anyway, the patch works great.  Haven't tested it with .NET yet either, 
but I will soon (when I reboot to windows).  However, it works great 
with my axis client that is generated from wsdl.

You mentioned that the exception is in the Axis namespace.  I can't say 
for sure, but I think a patch that I have here: 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18084
is probably related.  It helps axis do intelligent auto typing if there 
isn't a serializer pre-registered.  It doesn't put things in the default 
axis namespace, it uses the Namespace class to generate a namespace from 
the java type.

If you want to take a peek at my WSDL that is generated check here:
http://junktoast.com/EmployeeInfo.wsdl

Cheers,

- Dan Diephouse

David Green wrote:
> Steve,
> 
> All great questions.
> 
> re: What happens at the WSDL generation time?
> 
> WSDL generation is not affected by the patch, however it appears to me as if the proper
WSDL is already being generated, providing that your exceptions are declared in the throws
clause of your method declaration.
> 
> Wrt interop, it looks to me like the exception details are namespaced from the WSDL,
so that should work (speculation) -- however the exception class is Axis-namespace, so I doubt
that would work well with non-axis clients.
> 
> With regards to the other questions, I don't know.
> 
> David
> 

Mime
View raw message