Hi. I'm trying to invoke some Web Services which throw custom SOAP Faults using CXF 2.4.2 and DynamicClientFactory but I get the same NullPointerException error reported in Jira CXF-2555 (reported as fixed in 2.2.6) using similar test cases.
The fix in Jira includes code (ExceptionCreator in TypeClassInitializer) to generate a JAXWS-type exception class which is mandatory to fix the error, but I have noticed this code is not being reached for the MessagePartInfo parts corresponding to the FaultInfo message. In the physical code generation phase, DynamicClientFactory generates the exception faultInfo bean class, but not the jaxws excepcion class (the one that extends java.lang.Exception). Later, before returning the generated Client, the TypeClassInitializer service model visitor is called and is expected to generate the missing exception classes when visiting the MessagePartInfo parts related to the FaultInfo message. In my test cases, the visitor's "begin" method always return before generating the class due to the condition "if (!allowWrapperOperations && op.isUnwrappedCapable() && !op.isUnwrapped())". For this reason, when ClientFaultConverter asks for the exception class (which is supossed to be stored as a property of the FaultInfo message), it finds it null and generate the NPE. I modified the condition to "if (!isFault && !allowWrapperOperations && op.isUnwrappedCapable() && !op.isUnwrapped())" and my tests now work OK, but I'm afraid I'm maybe not taking into account all the wrapped/unwrapped variations. Will be this change enough to resolve the issue? Thank you very much. Regards, Esteban
