Hi Sabri, try to take a look to $AXIS2_BIN_HOME/samples/userguide/src/clients.
Hope this helps, Michele Rusda, Sabri wrote: > Hi Deepal, > > Thank you for the reply. > Could you please give me the example how to use it. How to costruct > OMElement as parameters. Any link for this ? > > > Regards, > sabri > > -----Original Message----- > From: Deepal Jayasinghe [mailto:[EMAIL PROTECTED] > Sent: Friday, August 18, 2006 11:58 PM > To: axis-user@ws.apache.org > Subject: Re: [AXIS2] Urgent! How to call service without return value > > Hi Rusda; > I am sorry for late reply. > As I can see in your service impl class, that does not have a return > value , so using /nvokeBlocking API /you are doing something wrong. > > If the method does not have a return values , please dont use InOut API > , please use one way invocation like/ > - fireAndForget or > -sendReboust > > That will solve your problem. > > Thanks > Deepal > / > Rusda, Sabri wrote: > >> Hello there, >> >> How to invoke Service without return value? What is the correct method >> to use ? >> >> I create simple Service like this : >> >> /package sample.axis;/ >> >> /public class HelloWorld {/ >> >> / public void sayHello(String msg) throws Exception {/ >> >> / System.out.println("Hello : "+msg);/ >> >> / }/ >> >> /}/ >> >> And here is the service.xml >> >> /<service name="HelloService">/ >> >> / <description>/ >> >> / This service is to get the running HelloWorld/ >> >> / </description>/ >> >> / <parameter name="ServiceClass" >> locked="false">sample.axis.HelloWorld</parameter>/ >> >> / <operation name="sayHello">/ >> >> / <messageReceiver >> class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />/ >> >> / </operation>/ >> >> /</service>/ >> >> And then, I made simple client : >> >> /package my.tutorial.simple;/ >> >> /import java.util.ArrayList;/ >> >> /import javax.xml.namespace.QName;/ >> >> /import org.apache.axis2.AxisFault;/ >> >> /import org.apache.axis2.Constants;/ >> >> /import org.apache.axis2.addressing.EndpointReference;/ >> >> /import org.apache.axis2.client.Options;/ >> >> /import org.apache.axis2.context.ConfigurationContext;/ >> >> /import org.apache.axis2.context.ConfigurationContextFactory;/ >> >> /import org.apache.axis2.rpc.client.RPCServiceClient;/ >> >> / / >> >> /public class ServiceClientVoid {/ >> >> / public static void main(String[] args) {/ >> >> / try {/ >> >> / String opName = "sayHello";/ >> >> / EndpointReference targetEPR = new >> > EndpointReference("http://localhost:8080/axis2/services/HelloService");/ >> / QName operationName = new QName("http://axis.sample/xsd", opName, >> "ns0");/ >> >> / Options options = new Options();/ >> >> / options.setTo(targetEPR);/ >> >> / options.setTransportInProtocol(Constants.TRANSPORT_HTTP);/ >> >> / / >> >> / ConfigurationContext configContext = >> > ConfigurationContextFactory.createConfigurationContextFromFileSystem(nul > l, >> null);/ >> >> / RPCServiceClient sender = new RPCServiceClient(configContext, > null);/ >> / sender.setOptions(options);/ >> >> / ArrayList params = new ArrayList();/ >> >> / params.add("from the dummies");/ >> >> / sender.invokeBlocking(operationName, params.toArray());/ >> >> / } catch (AxisFault e) {/ >> >> / e.printStackTrace();/ >> >> / }/ >> >> / }/ >> >> / / >> >> /}/ >> >> It's always throw the exception : >> >> org.apache.axis2.AxisFault: Incoming message input stream is null >> >> at >> > org.apache.axis2.transport.TransportUtils.createSOAPMessage(_TransportUt > ils.java:64_) >> at >> > org.apache.axis2.description.OutInAxisOperationClient.send(_OutInAxisOpe > ration.java:349_) >> at >> > org.apache.axis2.description.OutInAxisOperationClient.execute(_OutInAxis > Operation.java:279_) >> at >> > org.apache.axis2.client.ServiceClient.sendReceive(_ServiceClient.java:45 > 7_) >> at >> > org.apache.axis2.client.ServiceClient.sendReceive(_ServiceClient.java:39 > 9_) >> at >> > org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(_RPCServiceC > lient.java:60_) >> at > my.tutorial.simple.ServiceClientVoid.main(_ServiceClientVoid.java:41_) >> any help will be appreciate. >> >> Thank in advance, >> >> srusda >> > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]