You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jens Rutschmann <Je...@gmx.info> on 2009/06/25 13:19:55 UTC

POJO deployment and faults

Hi all,

currently I'm using POJO deployment with a single service class.
I'd like the generated WSDL to contain proper fault definitions, but when I'm 
using classes like the following then the WSDL contains far too much type 
definitions for all sort of Axis-internal classes.

Service class:
public class WSTest {
     public void moveFile(String src, String dst) throws IOFault {
         throw new IOFault("Error occurred when moving file.");
     }
}

IOFault class:
public class IOFault extends org.apache.axis2.AxisFault {
     public IOFault(String message) {
         super(message);
         super.setFaultCode("Fault code"); // for testing
         super.setFaultType(15);
     }
}

service.xml:
<service name="Test-WS"
	messageReceiver="org.apache.axis2.rpc.receivers.RPCMessageReceiver">
	<description>Test-WS</description>
	<parameter name="ServiceClass" locked="false">
		test.WSTest
	</parameter>
	<operation name="moveFile">
		<messageReceiver
			class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
	</operation>
</service>


The generated class now contains a *lot* of schema types for ContextManager, 
TransactionConfiguration, ThreadFactory and other axis classes.


Is it possible to use faults like in the "faulthandling" sample but with pojo 
deployment and a bottom-up approach (i.e. manually created fault classes and 
auto-generated WSDL)?

Or would the proper approach be top-down in this case? I.e. create the WSDL with 
at least the faults and then create Java classes of those using wsdl2java.

Best regards,
Jens