The subject of the mail contradicts with the content of the message. Just to make sure, hope you started the Axis2 server before making the call, right? Because this error typically comes out when the server can not be contacted.
-- Chinthaka
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
>
signature.asc
Description: OpenPGP digital signature
