axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.bai...@gamefederation.com
Subject wsdl2java fault bug ?
Date Mon, 11 Oct 2004 04:49:07 GMT
Anyone else observed that when you have code that throws multiple possible
faults, the generated stub assumes that the fault is always the last
defined ?

in this case, if you throw SomeOtherFault and verify that the XML going
over the wire correctly reflects the fault, client side it assumes the
fault relates to NoSuchUserFault and inturn complains about missing
faultcode (since its set for SomeOtherFault and not NoSuchUserFault since
we didnt want to throw that) ?

i.e

oper.addFault(new org.apache.axis.description.FaultDesc(
new javax.xml.namespace.QName("urn:userservice", "fault"),
"com.mypackage.faults.SomeOtherFault",
new javax.xml.namespace.QName("http://faults.mypackage.com",
"ServerFault"), true));

oper.addFault(new org.apache.axis.description.FaultDesc(
new javax.xml.namespace.QName("urn:userservice", "fault"),
"com.mypackage.faults.NoSuchUserFault",
new javax.xml.namespace.QName("http://faults.mypackage.com",
"NoSuchUserFault"), true));

try
{
  // do stuff that might generate these exceptions
}
catch(NoSuchUserException nsue)
{
  throw new com.mypackage.faults.NoSuchUserFault(nsue.getUsername());
}
catch(SomeOtherException soe)
{
  throw new com.mypackage.faults.SomeOtherFault(soe.getUsername());
}

/tom


Mime
View raw message