BTW,

I used the option unwrap="true" when generating the client stub. That way you get a nice String-array for interface.
Ant task:

    <taskdef
        name="wsdl2code"
        classname="org.apache.axis2.tool.ant.AntCodegenTask"
        classpathref="axis2.class.path"    />
 
    <target name="generate-client">
        <wsdl2code
           wsdlfilename="verysimpleservice.wsdl"
           skipbuildxml="true"
           namespacetopackages="http://myservices=myservices.client"
           targetsourcefolderlocation="src"
           overwrite="true"
           unwrap="true" />
    </target>



Roel Verbunt schreef:
Marios,

Here's a very simple service class that accepts a String array

-----------------------------------------------------
package myservices;
public class VerySimpleService {
       public int countStrings (String[] myStrings) {
           return myStrings.length;
       }
}
-------------------------------------------------------

Next generate a WSDL for it (with java2wsdl) as attached. Generate a client stub from this WSDL, with wsdl2java. 

Finally write your client that uses the generated stub, e.g:
-----------------------------------------------------------------------------
package myservices.client;
import java.rmi.RemoteException;
public class VerySimpleClient {
    public static void main(String[] args) throws RemoteException {
        VerySimpleServiceStub service = new VerySimpleServiceStub();
        String [] request = {"1st element","2nd element","3rd element","last element"};
        int count = service.countStrings(request);
        System.out.println("Number of elements in array:" + count);
    }
}
----------------------------------------------------------------------------------------------------------

Good luck,

Roel



Marios Christoulakis schreef:
Thank you very much for your response. Can i have an example with an
array of string?

On Sat, 2008-01-12 at 19:26 +0100, Roel Verbunt wrote:
  
SOAP does not support collections of any type, because of weakly typing. 
So no Vector either. You can put all kind of different objects in a 
collection so this would cause a problem for your clients.
You should use an array of objects instead.

Roel


Marios Christoulakis wrote:
    
Hello i want to know how i can call a web service with
input argument Vector and how to get as an answer
vector.

I have been searching for a long time but i haven't
found anything.

To call the ws i use the method

OMElement result = sender.sendReceive(payload);

Thank you in advance.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





  
      
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

    



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to