I do not know of an example, but a Vector is handled like other types.  The
client for a method with one Vector parameter and a Vector return value
would look something like:

    Vector v = new Vector();
    v.addElement("Element 1");
    v.addElement("Element 2");

    Call call = new Call();
    call.setTargetObjectURI("urn:your-soap-service");
    call.setMethodName("yourMethodWithAVectorParameterAndReturn");

    Vector params = new Vector();
    params.addElement(new Parameter("arg1", Vector.class, v, null));
    call.setParams(params);

    // Invoke the call.
    Response resp;

    try {
      resp = call.invoke(url, "");
    } catch (SOAPException e) {
      System.err.println("Caught SOAPException (" +
                         e.getFaultCode() + "): " +
                         e.getMessage());
      return;
    }

    // Check the response.
    if (!resp.generatedFault()) {
      Parameter ret = resp.getReturnValue();
      v = (Vector) ret.getValue();
      // Do something with v
    } else {
      Fault fault = resp.getFault();
      System.err.println("Generated fault: " + fault);
    }

FYI, for interoperability with other SOAP implementations, using an array is
far better than using a Vector.

Scott Nichol

----- Original Message -----
From: "Indrasish N Basuroychowdhury"
<[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 02, 2002 11:06 AM
Subject: Re: Sample application using soap


> I have sent this mail earlier and sorry for the repetation. Need a sample
for
> serializing/deserializing and sending/receving Vector of objects for the
Java
> client. Can someone help me.
>
> Thanks,
>
> Indrasish.
>
>
> Scott Nichol wrote:
>
> > For Apache SOAP, you need to get it (http://xml.apache.org/dist/soap/)
and a
> > J2EE web container, such as Tomcat
> > (http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.4/).
You
> > install these and run the samples (see, e.g.,
> > http://www.scottnichol.com/apachesoapinstall.htm).  There are several
> > on-line tutorials such as
> > http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html and
> > http://www.javaworld.com/javaworld/jw-04-2001/jw-0427-soap.html.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Sridhar" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, July 02, 2001 3:24 PM
> > Subject: Sample application using soap
> >
> > Hi ,
> >
> > I would like to first start with a sample soap application, can anybody
> > guide me throught the process
> >
> > what do i need to downl load and where do i get the examples??
> >
> > Best Regards,
> > Sridha
> >
> > --
> > To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


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

Reply via email to