You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by Scott Nichol <sn...@scottnichol.com> on 2002/07/02 17:05:49 UTC

Re: Sample application using soap

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" <gs...@apar.com>
To: <so...@xml.apache.org>
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



Re: Sample application using soap

Posted by Scott Nichol <sn...@scottnichol.com>.
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"
<in...@fanniemae.com>
To: <so...@xml.apache.org>
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" <gs...@apar.com>
> > To: <so...@xml.apache.org>
> > 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:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Sample application using soap

Posted by Scott Nichol <sn...@scottnichol.com>.
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"
<in...@fanniemae.com>
To: <so...@xml.apache.org>
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" <gs...@apar.com>
> > To: <so...@xml.apache.org>
> > 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:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


Re: Sample application using soap

Posted by Indrasish N Basuroychowdhury <in...@fanniemae.com>.
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" <gs...@apar.com>
> To: <so...@xml.apache.org>
> 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:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>



Re: Sample application using soap

Posted by Indrasish N Basuroychowdhury <in...@fanniemae.com>.
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" <gs...@apar.com>
> To: <so...@xml.apache.org>
> 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:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>