You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-user@ws.apache.org by José Antonio Sánchez <ge...@gmail.com> on 2006/11/10 17:11:12 UTC
How to include arrays as input?
Hello, I'm developing some services with Muse and in one of them I
want it to receive an array of strings. I have defined the input
message as:
.......
<xsd:element name="Lookup">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Entry" type="xsd:string" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
.......
but then I get a method
String lookup(String param0) throws Exception;
So I tried with:
<xsd:element name="Lookup">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Entries" type="tns:EntriesType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="PackagesType">
<xsd:sequence>
<xsd:element name="Entry" type="xsd:string" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
but now I get
String lookup(Element param0) throws Exception;
According to the reference documentation, Muse comes with
serialization for basic types and their arrays, but how can I declare
an array in the wsdl so the generated method look something like
this:?
String lookup(String[] param0) throws Exception;
--
Regards.
José Antonio Sánchez
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org
Re: How to include arrays as input?
Posted by Daniel Jemiolo <da...@us.ibm.com>.
it won't work without change - the generated client has the type of the
method parameters in a static field (_REQUEST_PARAM_TYPES, I think). the
value in that array would need to be changed from "String.class" to
"String[].class".
send the generated .java file for the client, and I will make the changes
with a marker next to each one so you can see what the modifications were
and why. oh, and file a JIRA item if you want this fixed. :)
Dan
"José Antonio Sánchez" <ge...@gmail.com> wrote on 11/10/2006 11:40:11
AM:
> Does it apply also to the generated proxy? I mean, if I change the
> capability signature to
>
> String lookup(String[] param0)
>
> and then I generate a proxy and change it's signature from
>
> String lookup(String entry)
>
> to
>
> String lookup(String[] entry)
>
> will it work without further changes?
>
> On 11/10/06, Daniel Jemiolo <da...@us.ibm.com> wrote:
> > I think it's probably the case that wsdl2java does not recognize the
> > minOccurs/maxOccurs values as requiring an array. I'll ask Andrew to
chime
> > in with clarification, and if necessary, we'll file a bug to get this
> > support.
> >
> > In the meantime, yes, the Muse runtime that process requests will
handle
> > basic types and their arrays. If you change the method signature to:
> >
> > String[] lookup(String param0);
> >
> > and then return an array of strings, you will see them serialized
> > properly. Check out 'MyCapabilityImpl.java' in the 'wsrf' sample
project
> > to see an example of string arrays as a return value (albeit for
resource
> > properties).
> >
> > thanks,
> > Dan
> >
> >
> >
> > "José Antonio Sánchez" <ge...@gmail.com> wrote on 11/10/2006
11:11:12
> > AM:
> >
> > > Hello, I'm developing some services with Muse and in one of them I
> > > want it to receive an array of strings. I have defined the input
> > > message as:
> > >
> > > .......
> > > <xsd:element name="Lookup">
> > > <xsd:complexType>
> > > <xsd:sequence>
> > > <xsd:element name="Entry" type="xsd:string" minOccurs="0"
> > > maxOccurs="unbounded"/>
> > > </xsd:sequence>
> > > </xsd:complexType>
> > > </xsd:element>
> > > .......
> > >
> > > but then I get a method
> > >
> > > String lookup(String param0) throws Exception;
> > >
> > > So I tried with:
> > >
> > > <xsd:element name="Lookup">
> > > <xsd:complexType>
> > > <xsd:sequence>
> > > <xsd:element name="Entries" type="tns:EntriesType"/>
> > > </xsd:sequence>
> > > </xsd:complexType>
> > > </xsd:element>
> > >
> > > <xsd:complexType name="PackagesType">
> > > <xsd:sequence>
> > > <xsd:element name="Entry" type="xsd:string" minOccurs="0"
> > > maxOccurs="unbounded"/>
> > > </xsd:sequence>
> > > </xsd:complexType>
> > >
> > > but now I get
> > >
> > > String lookup(Element param0) throws Exception;
> > >
> > > According to the reference documentation, Muse comes with
> > > serialization for basic types and their arrays, but how can I
declare
> > > an array in the wsdl so the generated method look something like
> > > this:?
> > >
> > > String lookup(String[] param0) throws Exception;
> > >
> > > --
> > > Regards.
> > > José Antonio Sánchez
> > >
> > >
---------------------------------------------------------------------
> > > To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: muse-dev-help@ws.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: muse-user-help@ws.apache.org
> >
> >
>
>
> --
> Saludos.
> José Antonio Sánchez
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org
Re: How to include arrays as input?
Posted by José Antonio Sánchez <ge...@gmail.com>.
Does it apply also to the generated proxy? I mean, if I change the
capability signature to
String lookup(String[] param0)
and then I generate a proxy and change it's signature from
String lookup(String entry)
to
String lookup(String[] entry)
will it work without further changes?
On 11/10/06, Daniel Jemiolo <da...@us.ibm.com> wrote:
> I think it's probably the case that wsdl2java does not recognize the
> minOccurs/maxOccurs values as requiring an array. I'll ask Andrew to chime
> in with clarification, and if necessary, we'll file a bug to get this
> support.
>
> In the meantime, yes, the Muse runtime that process requests will handle
> basic types and their arrays. If you change the method signature to:
>
> String[] lookup(String param0);
>
> and then return an array of strings, you will see them serialized
> properly. Check out 'MyCapabilityImpl.java' in the 'wsrf' sample project
> to see an example of string arrays as a return value (albeit for resource
> properties).
>
> thanks,
> Dan
>
>
>
> "José Antonio Sánchez" <ge...@gmail.com> wrote on 11/10/2006 11:11:12
> AM:
>
> > Hello, I'm developing some services with Muse and in one of them I
> > want it to receive an array of strings. I have defined the input
> > message as:
> >
> > .......
> > <xsd:element name="Lookup">
> > <xsd:complexType>
> > <xsd:sequence>
> > <xsd:element name="Entry" type="xsd:string" minOccurs="0"
> > maxOccurs="unbounded"/>
> > </xsd:sequence>
> > </xsd:complexType>
> > </xsd:element>
> > .......
> >
> > but then I get a method
> >
> > String lookup(String param0) throws Exception;
> >
> > So I tried with:
> >
> > <xsd:element name="Lookup">
> > <xsd:complexType>
> > <xsd:sequence>
> > <xsd:element name="Entries" type="tns:EntriesType"/>
> > </xsd:sequence>
> > </xsd:complexType>
> > </xsd:element>
> >
> > <xsd:complexType name="PackagesType">
> > <xsd:sequence>
> > <xsd:element name="Entry" type="xsd:string" minOccurs="0"
> > maxOccurs="unbounded"/>
> > </xsd:sequence>
> > </xsd:complexType>
> >
> > but now I get
> >
> > String lookup(Element param0) throws Exception;
> >
> > According to the reference documentation, Muse comes with
> > serialization for basic types and their arrays, but how can I declare
> > an array in the wsdl so the generated method look something like
> > this:?
> >
> > String lookup(String[] param0) throws Exception;
> >
> > --
> > Regards.
> > José Antonio Sánchez
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: muse-dev-help@ws.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>
--
Saludos.
José Antonio Sánchez
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org
Re: How to include arrays as input?
Posted by Daniel Jemiolo <da...@us.ibm.com>.
Sorry - just realized you're example is arrays as parameters, not return
types, but the answer still holds...
Daniel Jemiolo/Durham/IBM@IBMUS wrote on 11/10/2006 11:23:48 AM:
> I think it's probably the case that wsdl2java does not recognize the
> minOccurs/maxOccurs values as requiring an array. I'll ask Andrew to
chime
> in with clarification, and if necessary, we'll file a bug to get this
> support.
>
> In the meantime, yes, the Muse runtime that process requests will handle
> basic types and their arrays. If you change the method signature to:
>
> String[] lookup(String param0);
>
> and then return an array of strings, you will see them serialized
> properly. Check out 'MyCapabilityImpl.java' in the 'wsrf' sample project
> to see an example of string arrays as a return value (albeit for
resource
> properties).
>
> thanks,
> Dan
>
>
>
> "José Antonio Sánchez" <ge...@gmail.com> wrote on 11/10/2006
11:11:12
> AM:
>
> > Hello, I'm developing some services with Muse and in one of them I
> > want it to receive an array of strings. I have defined the input
> > message as:
> >
> > .......
> > <xsd:element name="Lookup">
> > <xsd:complexType>
> > <xsd:sequence>
> > <xsd:element name="Entry" type="xsd:string" minOccurs="0"
> > maxOccurs="unbounded"/>
> > </xsd:sequence>
> > </xsd:complexType>
> > </xsd:element>
> > .......
> >
> > but then I get a method
> >
> > String lookup(String param0) throws Exception;
> >
> > So I tried with:
> >
> > <xsd:element name="Lookup">
> > <xsd:complexType>
> > <xsd:sequence>
> > <xsd:element name="Entries" type="tns:EntriesType"/>
> > </xsd:sequence>
> > </xsd:complexType>
> > </xsd:element>
> >
> > <xsd:complexType name="PackagesType">
> > <xsd:sequence>
> > <xsd:element name="Entry" type="xsd:string" minOccurs="0"
> > maxOccurs="unbounded"/>
> > </xsd:sequence>
> > </xsd:complexType>
> >
> > but now I get
> >
> > String lookup(Element param0) throws Exception;
> >
> > According to the reference documentation, Muse comes with
> > serialization for basic types and their arrays, but how can I declare
> > an array in the wsdl so the generated method look something like
> > this:?
> >
> > String lookup(String[] param0) throws Exception;
> >
> > --
> > Regards.
> > José Antonio Sánchez
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: muse-dev-help@ws.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org
Re: How to include arrays as input?
Posted by Daniel Jemiolo <da...@us.ibm.com>.
I think it's probably the case that wsdl2java does not recognize the
minOccurs/maxOccurs values as requiring an array. I'll ask Andrew to chime
in with clarification, and if necessary, we'll file a bug to get this
support.
In the meantime, yes, the Muse runtime that process requests will handle
basic types and their arrays. If you change the method signature to:
String[] lookup(String param0);
and then return an array of strings, you will see them serialized
properly. Check out 'MyCapabilityImpl.java' in the 'wsrf' sample project
to see an example of string arrays as a return value (albeit for resource
properties).
thanks,
Dan
"José Antonio Sánchez" <ge...@gmail.com> wrote on 11/10/2006 11:11:12
AM:
> Hello, I'm developing some services with Muse and in one of them I
> want it to receive an array of strings. I have defined the input
> message as:
>
> .......
> <xsd:element name="Lookup">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="Entry" type="xsd:string" minOccurs="0"
> maxOccurs="unbounded"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> .......
>
> but then I get a method
>
> String lookup(String param0) throws Exception;
>
> So I tried with:
>
> <xsd:element name="Lookup">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="Entries" type="tns:EntriesType"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
>
> <xsd:complexType name="PackagesType">
> <xsd:sequence>
> <xsd:element name="Entry" type="xsd:string" minOccurs="0"
> maxOccurs="unbounded"/>
> </xsd:sequence>
> </xsd:complexType>
>
> but now I get
>
> String lookup(Element param0) throws Exception;
>
> According to the reference documentation, Muse comes with
> serialization for basic types and their arrays, but how can I declare
> an array in the wsdl so the generated method look something like
> this:?
>
> String lookup(String[] param0) throws Exception;
>
> --
> Regards.
> José Antonio Sánchez
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-dev-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org