axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lovell, Jim M" <Lovell.Ji...@principal.com>
Subject LocalTransport
Date Thu, 07 Oct 2004 22:16:43 GMT
I have a web application that contains an Axis web service that is available for other applications
to connect through http. I also have a servlet in the same web application that I would like
to have access the service using the LocalTransport. I am having trouble getting the client
calls setup right for the local call. Can anyone give me some pointers.

	Here is the code I am using in the servlet.

	System.out.println("This is a test");

	String wsdd =

	"<deployment xmlns=\"http://xml.apache.org/axis/wsdd/\" " +

	"xmlns:java=\"" + WSDDConstants.URI_WSDD_JAVA + "\">\n" +

	" <transport name=\"local\" pivot=\"java:org.apache.axis.transport.local.LocalSender\"/>\n"
+

	" <service name=\"" + WSDDConstants.URI_WSDD + "\" provider=\"java:MSG\">\n" +

	" <parameter name=\"allowedMethods\" value=\"AdminService\"/>\n" +

	" <parameter name=\"className\" value=\"org.apache.axis.utils.Admin\"/>\n" +

	" </service>\n" +

	"</deployment>";

	

	try {

	

	//Service service = new Service();

	Service service = new Service(new XMLStringProvider(wsdd));

	Call call = (Call) service.createCall();

	call.setOperationName(new QName("LocalTester", "ReturnString"));

	call.addParameter(

	"str",

	org.apache.axis.Constants.XSD_STRING,

	javax.xml.rpc.ParameterMode.IN);

	call.setReturnType(org.apache.axis.Constants.XSD_STRING);

	

	call.setTransport( new LocalTransport() );

	String ret = (String) call.invoke(new Object[] { "Hello!" });

	System.out.println("Sent 'Hello!', got '" + ret + "'");

	} catch (Exception e) {

	e.printStackTrace();

	}

Mime
View raw message