I have written this client:
import java.net.*;
import java.util.*; import java.io.*; import org.apache.soap.*; import org.apache.soap.rpc.*; public class Client { public static void main(String[] args) throws Exception { String c_Nomefile=""; String [] lista = new File(".").list(); //crea lista URL url = ""> new URL( "http://localhost:8080/soap/servlet/rpcrouter"); System.out.println("ELENCO SERVIZI:"); for(int cx=0; cx<lista.length; cx++) if ( new File(lista[cx]).isFile() ) //verifica se è file if ( lista[cx].toLowerCase().lastIndexOf(".owl") >= 0) //e con estensione .owl System.out.println((" * "+lista[cx]+" ").substring(0,20)); System.out.print("Servizio principale: "); BufferedReader in1= new BufferedReader(new InputStreamReader(System.in)); String c_Nomefile1 = in1.readLine(); System.out.print("Servizio da comporre: "); BufferedReader in2= new BufferedReader(new InputStreamReader(System.in)); String c_Nomefile2 = in2.readLine(); c_Nomefile = c_Nomefile1 + c_Nomefile2; Call call = new Call(); call.setTargetObjectURI("urn:Composizione"); call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC); Vector params = new Vector(); params.addElement(new Parameter("file1", String.class, c_Nomefile1, null)); params.addElement(new Parameter("file2", String.class, c_Nomefile2, null)); call.setParams(params); try { call.setMethodName("metodi_xml"); Response resp = call.invoke(url, ""); if (resp.generatedFault()) { Fault fault = resp.getFault(); System.err.println("Generated fault: " + fault); } else { Parameter ret = resp.getReturnValue(); Object value = ret.getValue(); System.out.println("comp " + value); } } catch (SOAPException e) { System.err.println("Caught SOAPException (" + e.getFaultCode() + "): " + e.getMessage()); } } } The service is:
public class servizio {
public int metodi_xml(String file1, String file2)
{
int a; a=0; return a; } }
The .dd file is:
<isd:service
xmlns:isd="http://xml.apache.org/xml-soap/deployment" id="urn:Composizione"> <isd:provider type="java" scope="Application" methods="metodi_xml"> <isd:java class="servizio" static="false"/> </isd:provider> <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener> <isd:mappings> </isd:mappings> </isd:service> All this file are in:%CATALINA_HOME%\webapps\soap\WEB-INF\classes; when I
try java Client, I receive this exception:
Generated fault: [Attributes={}] [faultCode=SOAP-ENV:Server] [faultString=Except ion while handling service request: servizio.metodi_xml(java.lang.String,java.la ng.String) -- no signature match] [faultActorURI=/soap/servlet/rpcrouter] [Detai lEntries= [(0)=<stackTrace>java.lang.NoSuchMethodException: servizio.metodi_xml(java.lang. String,java.lang.String) -- no signature match at org.apache.soap.util.MethodUtils.getEntryPoint(MethodUtils.java:194) at org.apache.soap.util.MethodUtils.getMethod(MethodUtils.java:548) at org.apache.soap.util.MethodUtils.getMethod(MethodUtils.java:528) at org.apache.soap.server.RPCRouter.invoke(RPCRouter.java:114) at org.apache.soap.providers.RPCJavaProvider.invoke(RPCJavaProvider.java :129) at org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet. java:354) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
2422) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j ava:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche rValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j ava:163) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:19
9) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java :828) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce ssConnection(Http11Protocol.java:700) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java :584) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP ool.java:683) at java.lang.Thread.run(Thread.java:534) </stackTrace>] ] [FaultEntries=] C:\Programmi\jakarta-tomcat-4.1.30\webapps\soap\WEB-INF\classes>java
Client
ELENCO SERVIZI: * prova2.owl * prova1.owl Servizio principale: prova1 Servizio da comporre: prova2 Generated fault: [Attributes={}] [faultCode=SOAP-ENV:Server] [faultString=Except ion while handling service request: servizio.metodi_xml(java.lang.String,java.la ng.String) -- no signature match] [faultActorURI=/soap/servlet/rpcrouter] [Detai lEntries= [(0)=<stackTrace>java.lang.NoSuchMethodException: servizio.metodi_xml(java.lang. String,java.lang.String) -- no signature match at org.apache.soap.util.MethodUtils.getEntryPoint(MethodUtils.java:194) at org.apache.soap.util.MethodUtils.getMethod(MethodUtils.java:548) at org.apache.soap.util.MethodUtils.getMethod(MethodUtils.java:528) at org.apache.soap.server.RPCRouter.invoke(RPCRouter.java:114) at org.apache.soap.providers.RPCJavaProvider.invoke(RPCJavaProvider.java :129) at org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet. java:354) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
2422) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j ava:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche rValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j ava:163) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex t.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:19
9) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java :828) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce ssConnection(Http11Protocol.java:700) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java :584) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP ool.java:683) at java.lang.Thread.run(Thread.java:534) </stackTrace>] ] [FaultEntries=] WHY?
---- |
- Re: method not founded Francesco Dipalo
- Re: method not founded Scott Nichol
- Re: method not founded Francesco Dipalo