You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ax...@ws.apache.org on 2004/10/11 11:59:51 UTC

[jira] Created: (AXIS-1599) wsdl2java handles faults incorrectly

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXIS-1599

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXIS-1599
    Summary: wsdl2java handles faults incorrectly
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Axis
 Components: 
             Deployment / Registries
   Versions:
             1.2RC2

   Assignee: 
   Reporter: thomas bailey

    Created: Mon, 11 Oct 2004 2:59 AM
    Updated: Mon, 11 Oct 2004 2:59 AM

Description:
WSDL2Java generates the same qname for all each fault. In a scenario where more than one fault might be thrown, the generated stub always assumes the fault to the last defined.

For example, 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 throw that).

A work around is to amend the generated WSDL giving each fault a different qname.

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());
}


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira