Hopefully some axis guru will tell me Im way off but my understanding the
problem is you would still loose interop since you still rely on knowing
what an exception is on the client side (?). Besides which I think you
probably want possible faults described in the wsdl so clients can figure
out exactly what elements they can expect.

For example, I want to be able to tell a client that if they call
addOrganisation(int id) and that id is taken that the organisation already
exists. I have a OrganisationExistsException which I can throw about
server side but before it goes over the wire I convert to axis fault:

catch(NoSuchOrganisationException nsoe)
{
  logger.debug("organisation with id " + nsoe.getOrganisationId() + " does
not exist");
  throw NoSuchOrganisationFault.makeFault(nsoe);
}

a NoSuchOrganisationFault definition is then in the wsdl:

<complexType name="OrganisationExistsFault">
<complexContent>
<extension base="tns2:AxisFault">
<sequence />
</extension>
</complexContent>
</complexType>

This way a client knows that when they see a NoSuchOrganisationFault they
can expect a cause, a fault code, a fault reason or anything that ive
added specifically to the NoSuchOrganisationFault fault since it inherits
all elements from axisfault.

result = $client->call('addOrganisation', $organisationid);
// php client can now check for a fault and process it
if ($client->fault) { etc

/t




> Please comment on this pseudocode for exception handling.
> The majority of the client and server code would throw
> subclasses of DetailedException, which would not be axis-
> specific. That would be converted to and from an
> AxisFault, and a generic fault would be sent over the
> wire (illustrated at the end).

Reply via email to