[ 
http://jira.codehaus.org/browse/XFIRE-719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=231673#action_231673
 ] 

Aleksander Adamowski commented on XFIRE-719:
--------------------------------------------

Just for the record, the exception "java.lang.IllegalArgumentException: A fault 
with name [ExceptionName] already exists in this operation" can also be thrown 
by CXF when publishing a JAX-WS endpoint, where a web method has the same 
exception listed twice in its "throws" clause.

E.g.:

@WebMethod
public ReturnType someOperation(@WebParam(name = "someParam1") final String 
someParam1,
                                @WebParam(name = "someParam2") final String 
someParam2)
            throws SomeCustomException1, SomeCustomException2, 
SomeCustomException1

Yes, it makes no sense but I've seen some absent-minded developers put those 
duplicate exception declarations and javac doesn't complain.

> Client generation takes wrong name for faults
> ---------------------------------------------
>
>                 Key: XFIRE-719
>                 URL: http://jira.codehaus.org/browse/XFIRE-719
>             Project: XFire
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 1.2.2
>            Reporter: Frank Grupe
>            Assignee: Dan Diephouse
>             Fix For: 1.2.3
>
>
> Hi,
> I have build a WebService Operation throwing multiple faults each containing 
> the same Data Element:
> <s:element name="WebServiceFaultDetail">
> <s:complexType>
> <s:sequence>
> <s:element maxOccurs="1" minOccurs="0" name="detailMessage" type="s:string"/>
> <s:element maxOccurs="1" minOccurs="0" name="code" type="s:string"/>
> </s:sequence>
> </s:complexType>
> </s:element>
> ...
> <wsdl:message name="AuthenticationFailedFault">
> <wsdl:part name="AuthenticationFailedFault" 
> element="ns1:WebServiceFaultDetail"/>
> </wsdl:message>
> <wsdl:message name="ServiceNotAvailableFault">
> <wsdl:part name="ServiceNotAvailableFault" 
> element="ns1:WebServiceFaultDetail"/>
> </wsdl:message>
> <wsdl:message name="DeviceNotFoundFault">
> <wsdl:part name="DeviceNotFoundFault" element="ns1:WebServiceFaultDetail"/>
> </wsdl:message>
> ...
> <wsdl:operation name="GetDeviceInformation">
> <wsdl:input name="GetDeviceInformationRequest" 
> message="tns:GetDeviceInformationRequest"/>
> <wsdl:output name="GetDeviceInformationResponse" 
> message="tns:GetDeviceInformationResponse"/>
> <wsdl:fault name="AuthenticationFailedFault" 
> message="tns:AuthenticationFailedFault"/>
> <wsdl:fault name="DeviceNotFoundFault" message="tns:DeviceNotFoundFault"/>
> <wsdl:fault name="ServiceNotAvailableFault" 
> message="tns:ServiceNotAvailableFault"/>
> </wsdl:operation>
> But when generating a client from this WSDL, the generated Exception's faults 
> are all named "WebServiceFaultDetail" instead of  
> "AuthenticationFailedFault/DeviceNotFoundFault/ServiceNotAvailableFault":
> public class AuthenticationFailedFault    extends FaultInfoException
> {
> ...
>     public static QName getFaultName() {
>         return new 
> QName("http://www.arvato.de/telco/tass/service/web/deviceinformation/types";, 
> "WebServiceFaultDetail");
>     }
> }
> So when invoking the client, I get the following expected Exception:
> java.lang.IllegalArgumentException: A fault with name [WebServiceFaultDetail] 
> already exists in this operation
>       at 
> org.codehaus.xfire.service.OperationInfo.addFault(OperationInfo.java:197)
>       at 
> org.codehaus.xfire.service.binding.ObjectServiceFactory.addFault(ObjectServiceFactory.java:908)
>       at 
> org.codehaus.xfire.service.binding.ObjectServiceFactory.initializeFaults(ObjectServiceFactory.java:881)
>       at 
> org.codehaus.xfire.service.binding.ObjectServiceFactory.addOperation(ObjectServiceFactory.java:801)
>       at 
> org.codehaus.xfire.service.binding.ObjectServiceFactory.initializeOperations(ObjectServiceFactory.java:706)
>       at 
> org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:410)
>       at 
> org.codehaus.xfire.annotations.AnnotationServiceFactory.create(AnnotationServiceFactory.java:246)
>       at 
> org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:345)
>       at 
> de.arvato.telco.tass.service.web.client.DeviceInformationServiceClient.create0(DeviceInformationServiceClient.java:59)
>       at 
> de.arvato.telco.tass.service.web.client.DeviceInformationServiceClient.<init>(DeviceInformationServiceClient.java:26)
>       at 
> de.arvato.telco.tass.service.web.client.DeviceInformationTestClient.main(DeviceInformationTestClient.java:18)
> Fault names in the generated Exceptions should match the fault names in the 
> operations and not their associated data elements, right?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to