You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Vinod Soni <vi...@btinternet.com> on 2001/11/30 12:15:02 UTC
How to set params with multiple names and values ?
Hi,
I have this little query. If I want to pass simple String params in a SOAP call, I do something like this:
Vector params = new Vector();
params.addElement(new Parameter("param1", String.class, "param1", null));
params.addElement(new Parameter("param2", String.class, "param2", null));
call.setParams(params);
and the XML envelope comtains something like:
<ns1:methodname xml:ns1="urn:XYZ" .....>
<param1 xsi:type="xsd:string">param1</param1>
<param2 xsi:type="xsd:string">param2</param1>
</ns1:methodname>
But now, I want the XML envelope to look something like this:
<ns1:methodname xml:ns1="urn:XYZ".....>
<params>
<param1 xsi:type="xsd:string">param1</param1>
<param2>
<param2A name='attribute1' type='type1' multi='no'>value1</param2A>
<param2A name='attribute2' type='type2' multi='yes'>value2a; value2b; value2c</param2A>
</param2>
</ns1:methodname>
Can anyone sugguest me how can I do that by setting params in the Call object ?
TIA
Vinod.
Re: How to set params with multiple names and values ?
Posted by Vinod Soni <vi...@btinternet.com>.
Thanks Richard. Let me give it a try.
----- Original Message -----
From: "Richard Boehme" <bo...@acm.jhu.edu>
To: "Soap User" <so...@xml.apache.org>; "Vinod Soni"
<vi...@btinternet.com>
Sent: Friday, November 30, 2001 3:28 PM
Subject: Re: How to set params with multiple names and values ?
> What about enclosing the parameters in a parameter, something like this?
> (my synatax may be a bit off)...
>
> Parameter params2[2] = { new Parameter("param2A", String.class,
> "param2A", null), new Parameter("param2B", String.class, "param2B", null)
> }
> params.addElement(new Parameter("param2", Parameter[].class, params2,
> null));
>
> --Richard
>
>
> On Fri, 30 Nov 2001, Vinod Soni wrote:
>
> > Hi,
> >
> > I have this little query. If I want to pass simple String params in a
SOAP call, I do something like this:
> >
> > Vector params = new Vector();
> > params.addElement(new Parameter("param1", String.class, "param1",
null));
> > params.addElement(new Parameter("param2", String.class, "param2",
null));
> > call.setParams(params);
> >
> > and the XML envelope comtains something like:
> > <ns1:methodname xml:ns1="urn:XYZ" .....>
> > <param1 xsi:type="xsd:string">param1</param1>
> > <param2 xsi:type="xsd:string">param2</param1>
> > </ns1:methodname>
> >
> > But now, I want the XML envelope to look something like this:
> > <ns1:methodname xml:ns1="urn:XYZ".....>
> > <params>
> > <param1 xsi:type="xsd:string">param1</param1>
> > <param2>
> > <param2A name='attribute1' type='type1'
multi='no'>value1</param2A>
> > <param2A name='attribute2' type='type2' multi='yes'>value2a;
value2b; value2c</param2A>
> > </param2>
> > </ns1:methodname>
> >
> > Can anyone sugguest me how can I do that by setting params in the Call
object ?
> >
> > TIA
> > Vinod.
> >
>
>
Re: How to set params with multiple names and values ?
Posted by Vinod Soni <vi...@btinternet.com>.
Thanks Richard. Let me give it a try.
----- Original Message -----
From: "Richard Boehme" <bo...@acm.jhu.edu>
To: "Soap User" <so...@xml.apache.org>; "Vinod Soni"
<vi...@btinternet.com>
Sent: Friday, November 30, 2001 3:28 PM
Subject: Re: How to set params with multiple names and values ?
> What about enclosing the parameters in a parameter, something like this?
> (my synatax may be a bit off)...
>
> Parameter params2[2] = { new Parameter("param2A", String.class,
> "param2A", null), new Parameter("param2B", String.class, "param2B", null)
> }
> params.addElement(new Parameter("param2", Parameter[].class, params2,
> null));
>
> --Richard
>
>
> On Fri, 30 Nov 2001, Vinod Soni wrote:
>
> > Hi,
> >
> > I have this little query. If I want to pass simple String params in a
SOAP call, I do something like this:
> >
> > Vector params = new Vector();
> > params.addElement(new Parameter("param1", String.class, "param1",
null));
> > params.addElement(new Parameter("param2", String.class, "param2",
null));
> > call.setParams(params);
> >
> > and the XML envelope comtains something like:
> > <ns1:methodname xml:ns1="urn:XYZ" .....>
> > <param1 xsi:type="xsd:string">param1</param1>
> > <param2 xsi:type="xsd:string">param2</param1>
> > </ns1:methodname>
> >
> > But now, I want the XML envelope to look something like this:
> > <ns1:methodname xml:ns1="urn:XYZ".....>
> > <params>
> > <param1 xsi:type="xsd:string">param1</param1>
> > <param2>
> > <param2A name='attribute1' type='type1'
multi='no'>value1</param2A>
> > <param2A name='attribute2' type='type2' multi='yes'>value2a;
value2b; value2c</param2A>
> > </param2>
> > </ns1:methodname>
> >
> > Can anyone sugguest me how can I do that by setting params in the Call
object ?
> >
> > TIA
> > Vinod.
> >
>
>
Re: How to set params with multiple names and values ?
Posted by Richard Boehme <bo...@acm.jhu.edu>.
What about enclosing the parameters in a parameter, something like this?
(my synatax may be a bit off)...
Parameter params2[2] = { new Parameter("param2A", String.class,
"param2A", null), new Parameter("param2B", String.class, "param2B", null)
}
params.addElement(new Parameter("param2", Parameter[].class, params2,
null));
--Richard
On Fri, 30 Nov 2001, Vinod Soni wrote:
> Hi,
>
> I have this little query. If I want to pass simple String params in a SOAP call, I do something like this:
>
> Vector params = new Vector();
> params.addElement(new Parameter("param1", String.class, "param1", null));
> params.addElement(new Parameter("param2", String.class, "param2", null));
> call.setParams(params);
>
> and the XML envelope comtains something like:
> <ns1:methodname xml:ns1="urn:XYZ" .....>
> <param1 xsi:type="xsd:string">param1</param1>
> <param2 xsi:type="xsd:string">param2</param1>
> </ns1:methodname>
>
> But now, I want the XML envelope to look something like this:
> <ns1:methodname xml:ns1="urn:XYZ".....>
> <params>
> <param1 xsi:type="xsd:string">param1</param1>
> <param2>
> <param2A name='attribute1' type='type1' multi='no'>value1</param2A>
> <param2A name='attribute2' type='type2' multi='yes'>value2a; value2b; value2c</param2A>
> </param2>
> </ns1:methodname>
>
> Can anyone sugguest me how can I do that by setting params in the Call object ?
>
> TIA
> Vinod.
>
Re: How to set params with multiple names and values ?
Posted by Richard Boehme <bo...@acm.jhu.edu>.
What about enclosing the parameters in a parameter, something like this?
(my synatax may be a bit off)...
Parameter params2[2] = { new Parameter("param2A", String.class,
"param2A", null), new Parameter("param2B", String.class, "param2B", null)
}
params.addElement(new Parameter("param2", Parameter[].class, params2,
null));
--Richard
On Fri, 30 Nov 2001, Vinod Soni wrote:
> Hi,
>
> I have this little query. If I want to pass simple String params in a SOAP call, I do something like this:
>
> Vector params = new Vector();
> params.addElement(new Parameter("param1", String.class, "param1", null));
> params.addElement(new Parameter("param2", String.class, "param2", null));
> call.setParams(params);
>
> and the XML envelope comtains something like:
> <ns1:methodname xml:ns1="urn:XYZ" .....>
> <param1 xsi:type="xsd:string">param1</param1>
> <param2 xsi:type="xsd:string">param2</param1>
> </ns1:methodname>
>
> But now, I want the XML envelope to look something like this:
> <ns1:methodname xml:ns1="urn:XYZ".....>
> <params>
> <param1 xsi:type="xsd:string">param1</param1>
> <param2>
> <param2A name='attribute1' type='type1' multi='no'>value1</param2A>
> <param2A name='attribute2' type='type2' multi='yes'>value2a; value2b; value2c</param2A>
> </param2>
> </ns1:methodname>
>
> Can anyone sugguest me how can I do that by setting params in the Call object ?
>
> TIA
> Vinod.
>