Date: 2005-03-15T11:25:58
Editor: DinoChiesa
Wiki: Apache Web Services Wiki
Page: DotNetInteropArrays
URL: http://wiki.apache.org/ws/DotNetInteropArrays
completed the java code.
Change Log:
------------------------------------------------------------------------------
@@ -8,7 +8,7 @@
Ok, then Within the WSDL, in the <types> section, specify a type or element
that wraps an array, using an element with maxOccurs != 1, like so:
{{{
- <s:complexType name="Container">
+ <s:complexType name="Container">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="param1" nillable="true"
type="s:string" />
<s:element minOccurs="0" maxOccurs="unbounded" name="param2"
type="s:string" />
@@ -55,7 +55,7 @@
<param2>bar</param2>
<param2>blah</param2>
...
- </Container>
+ </Container>
}}}
And the .NET client will be completely happy with that.
@@ -64,7 +64,7 @@
{{{
- <s:complexType name="Container">
+ <s:complexType name="Container">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="param1" nillable="true"
type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="wrapper" nillable="true"
type="tns:ArrayOfString" />
@@ -81,13 +81,39 @@
(the Array''''''Of''''''Xxx name is actually not significant, just the
structure is important.)
... then the generated Java code will look like:
{{{
- class Container {
- String param1;
- ArrayOfString wrapper;
- }
+ class Container {
+ String param1;
+ ArrayOfString wrapper;
+
+ public String getParam1() {
+ return param1;
+ }
+ public void setParam1(String value) {
+ param1 = value;
+ }
+ public String getWrapper() {
+ return wrapper;
+ }
+ public void setWrapper(ArrayOfString value) {
+ wrapper= value;
+ }
+ }
class ArrayOfString{
String[] param2;
+
+ public String getParam2(index i) {
+ return param2[i];
+ }
+ public void setParam2(index i, String value) {
+ param2[i] = value;
+ }
+ public String[] getParam2() {
+ return param2;
+ }
+ public void setParam2(String[] value) {
+ param2 = value;
+ }
}
}}}