Hi,
 I am using apache soap to transfer xml data between a client and server and vice 
versa.
 I want to transfer a set of strings as parameter to the remote procedure call.
 I have inserted the strings into a Vector and then I am sending this vector as 
parameter .
 The code is as follows on the client side:-

    Call call=new Call();
    call.setSOAPMappingRegistry(new SOAPMappingRegistry());
    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
    call.setTargetObjectURI("urn:DB");
    call.setMethodName("myFunction");
    Vector params=new Vector();
    Vector vect = new Vector();
    vect.addElement(args[1]);
    vect.addElement(args[2]);
    params.addElement(new Parameter("vect",Vector.class,vect,null));             
    call.setParams(params);
    Response resp = null; 
    try 
         { 
            resp = call.invoke(url, ""); 
         } 
    catch( SOAPException e ) 
         { 
            System.err.println("Caught SOAPException (" + e.getFaultCode() + "): " + 
e.getMessage()); 
            System.exit(-1); 
         } 
     if( !resp.generatedFault() ) 
        { 
            Parameter ret = resp.getReturnValue(); 
            Object value = ret.getValue(); 
            System.out.println(value); 
        } 
    else 
         { 
            Fault fault = resp.getFault(); 
            System.err.println("Generated fault: "); 
            System.out.println (" Fault Code = " + fault.getFaultCode()); 
            System.out.println (" Fault String = " + fault.getFaultString()); 
         } 
      } 


The function myFunction on the server side is:

public String searchList(Vector vect)
  {
    String arg1 = (vect.elementAt(0)).toString();
    String arg2 = (vect.elementAt(1)).toString();
  }

However it gives an error:-
Fault Code = SOAP_ENV:Server
Fault String = myPackage.myServer.myFunction(java.lang.Object[]) -- no signature match

Please suggest a way in which I can transmit a set of strings as parameter.

thanx,
siddharth

 



Reply via email to