I just run ur code with small modification and it worked  for me and got
the folliwng result

<ns1:addInventoryResponse
xmlns:ns1="http://org.apache.axis2/xsd";><return>456</return></ns1:addInventoryResponse>

the only modification I have done to ur client code is
QName qn = new QName("http://org.apache.axis2/xsd";, "addInventory");

and I did  not do any modification to service code

btw wt the Axis2 version that ur using ?

atoi atoi wrote:

>I have the following service deployed on axis2:
>public class InventoryService {
>  public int addInventory(String sku, int quantity) {
>//do something
>    return quantity;
>  }
>
>with the following services.xml
>
><service name="InventoryService">
>    <parameter name="ServiceClass"
>locked="false">ch02.InventoryService</parameter>
>    <operation name="addInventory">
>        <messageReceiver 
>mep="http://www.w3.org/2004/08/wsdl/in-out";
>class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
>    </operation>
></service>
>
>Here is the client code:
>public class InventoryClient {
>    private static EndpointReference targetEPR = new
>EndpointReference("http://localhost:8081/axis2/services/InventoryService";);
>  public static void main(String[] args) throws
>Exception {
>        try {
>       QName qn = new QName("http://ch02","addInventory";);
>       String sku = "ANT456";
>       Integer quantity = new Integer("456");
>       Object [] inputParams = new Object[]
>{"ant123","456"};
>
>            Options options = new Options();
>            options.setTo(targetEPR);
>           
>options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>
>            //Blocking invocation
>            RPCServiceClient sender = new
>RPCServiceClient();
>            sender.setOptions(options);
>             OMElement result =
>sender.invokeBlocking(qn,inputParams);
>
>            StringWriter writer = new StringWriter();
>           
>result.serialize(XMLOutputFactory.newInstance()
>                    .createXMLStreamWriter(writer));
>            writer.flush();
>
>            System.out.println(writer.toString());
>
>        } catch (AxisFault axisFault) {
>            axisFault.printStackTrace();
>        }
>
>  }
>}
>
>I keep getting the following error:
>
><?xml version='1.0'
>encoding='UTF-8'?><soapenv:Envelope
>xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";><soapenv:Header
>/><soapenv:Body><soapenv:Fault><faultcode>Client</faultcode><faultstring>Raw
>Xml provider supports only the methods bearing the
>signature public OMElement
>&amp;lt;method-name&amp;gt;(OMElement) where the
>method name can be
>anything</faultstring><faultactor>http://myAxisServer/role/default</faultactor><detail><soapenv:Exception>org.apache.axis2.AxisFault:
>Raw Xml provider supports only the methods bearing the
>signature public OMElement
>&amp;lt;method-name&amp;gt;(OMElement) where the
>method name can be anything
>
>       at
>org.apache.axis2.receivers.RawXMLINOutMessageReceiver.invokeBusinessLogic(RawXMLINOutMessageReceiver.java:121)
>
>       at
>org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:37)
>
>       at
>org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:331)
>
>       at
>org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:274)
>
>       at
>org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:150)
>
>       at
>javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>
>       at
>javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
>       at
>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
>
>       at
>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
>
>       at
>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
>
>       at
>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>
>       at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>
>       at
>org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
>
>       at
>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
>
>       at
>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>
>       at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>
>       at
>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
>
>       at
>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>
>       at
>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
>
>       at
>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
>
>       at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>
>       at
>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>
>       at
>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>
>       at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>
>       at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
>
>       at
>org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
>
>       at
>org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
>
>       at
>org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
>
>       at
>org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
>
>       at
>org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
>
>       at java.lang.Thread.run(Thread.java:534)
>
></soapenv:Exception></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
>
>
>Why isnt rpcMessageReceiver picking this up?
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>
>
>  
>

-- 
Thanks,
Deepal
................................................................
~Future is Open~ 


Reply via email to