I am using the attached java code (consumerservice.txt) to create a server. It seems to work and the wsdl is generated correctly. However when the attached message is sent the attached fault is raised. Any help would be appreciated

_________________________________________________________________
MSN Hotmail is evolving – check out the new Windows Live Mail http://ideas.live.com
package com.test.server;

import javax.xml.namespace.QName;

import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.AddressingConstants;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.description.AxisOperation;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver;
import org.apache.axis2.transport.http.SimpleHTTPServer;
import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2004Constants;

public class ConsumerService
{
public static final String ROUTE_RESPONSE_ACTION = "http://www.contoso.com/SampleServices/RouteResponse";;

   public static final String SERVICE_NAME = "ConsumerService";

   public static final String MACHINE_NAME = "ip address";

   public static final int SERVICE_PORT = 9090;

public static final String SERVER_URL = "http://"; + MACHINE_NAME + ":" + SERVICE_PORT;

   public static final String SERVICE_URL = SERVER_URL + "/axis2/services/"
           + SERVICE_NAME;

   public class ConsumerServiceOperations
   {

       public void routeResponse(OMElement element)
       {
           System.out.println("Route response message received:");
           System.out.println(element);
       }

       public void fault(OMElement element)
       {
           System.out.println("Fault message received:");
           System.out.println(element);
       }
   }

   private SimpleHTTPServer server;

   public void stop(){
       server.stop();
   }

   public ConsumerService()
   {
       try
       {
ConfigurationContext context = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);

AxisService service = AxisService.createService(ConsumerServiceOperations.class.getName(), context.getAxisConfiguration());
           CSFUtil.engageModules(service);
           service.setName(SERVICE_NAME);

AxisOperation faultOperation = service.getOperation(new QName("fault")); faultOperation.setSoapAction(AddressingConstants.Final.WSA_FAULT_ACTION); service.mapActionToOperation(AddressingConstants.Final.WSA_FAULT_ACTION, faultOperation);

AxisOperation routeResponseOperation = service.getOperation(new QName("routeResponse"));
           routeResponseOperation.setSoapAction(ROUTE_RESPONSE_ACTION);
service.mapActionToOperation(ROUTE_RESPONSE_ACTION, routeResponseOperation);

           context.getAxisConfiguration().addService(service);

           server = new SimpleHTTPServer(context,SERVICE_PORT);
           server.start();
       }
       catch (AxisFault fault)
       {

       }
   }

   public static void main(String[] args)
   {
       ConsumerService service = new ConsumerService();
   }
}

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
	<soapenv:Header />
	<soapenv:Body>
		<soapenv:Fault>
			<faultcode>soapenv:Client</faultcode>
			<faultstring>unknown</faultstring>
			<detail>
				<Exception>java.lang.NullPointerException
	at org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver.invokeBusinessLogic(RPCInOnlyMessageReceiver.java:107)
	at org.apache.axis2.receivers.AbstractInMessageReceiver.receive(AbstractInMessageReceiver.java:35)
	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:497)
	at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:328)
	at org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:230)
	at org.apache.axis2.transport.http.server.DefaultHttpServiceProcessor.doService(DefaultHttpServiceProcessor.java:189)
	at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:123)
	at org.apache.axis2.transport.http.server.DefaultHttpServiceProcessor.run(DefaultHttpServiceProcessor.java:261)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
	at java.lang.Thread.run(Thread.java:534)
				</Exception>
			</detail>
		</soapenv:Fault
></soapenv:Body>
</soapenv:Envelope>
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"; 
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"; 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"; 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
	<soap:Header>
		<wsa:Action>http://www.contoso.com/SampleServices/RouteResponse</wsa:Action>
		<wsa:FaultTo>
			<wsa:Address>http://servertoreplyto.com/service</wsa:Address>
		</wsa:FaultTo>
		<wsa:From>
			<wsa:Address>http://servertoreplyto.com/service</wsa:Address>
		</wsa:From>
		<wsa:MessageID>urn:uuid:4f2faa3c-f01a-4813-94bd-68c45bafa887</wsa:MessageID>
		<wsa:RelatesTo>urn:uuid:DBEAE6C2E2FD748B7B11692035690732</wsa:RelatesTo>
		<wsa:ReplyTo>
			<wsa:Address>http://servertoreplyto.com/service</wsa:Address>
		</wsa:ReplyTo>
		<wsa:To>http://ip address:9090/axis2/services/ConsumerService</wsa:To>
		<wsse:Security>
			<wsu:Timestamp wsu:Id="Timestamp-ef61005e-2744-43bc-bce4-043540cbdf8e">
				<wsu:Created>2007-01-19T10:46:09Z</wsu:Created>
				<wsu:Expires>2007-01-19T10:51:09Z</wsu:Expires>
			</wsu:Timestamp>
		</wsse:Security>
	</soap:Header>
	<soap:Body>
		<ns1:TestMessage xmlns:ns1="http://namespace.org/";>
			<TestMessageResult xmlns="http://namespace.org/";>Test Message</TestMessageResult>
		</ns1:TestMessage>
	</soap:Body>
</soap:Envelope>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to