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(null,
> 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(_TransportUtils.java:64_)
>
> at
> org.apache.axis2.description.OutInAxisOperationClient.send(_OutInAxisOperation.java:349_)
>
> at
> org.apache.axis2.description.OutInAxisOperationClient.execute(_OutInAxisOperation.java:279_)
>
> at
> org.apache.axis2.client.ServiceClient.sendReceive(_ServiceClient.java:457_)
>
> at
> org.apache.axis2.client.ServiceClient.sendReceive(_ServiceClient.java:399_)
>
> at
> org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(_RPCServiceClient.java:60_)
>
> at my.tutorial.simple.ServiceClientVoid.main(_ServiceClientVoid.java:41_)
>
> any help will be appreciate.
>
> Thank in advance,
>
> srusda
>
--
Thanks,
Deepal
................................................................
~Future is Open~
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]