Hi everybody,
I have 2 questions regarding WebServices DataTypes:
1. Problem with String Arrays
I created a function in J2EE exposed as a web-service that returns a string array to the caller:
/** * @jboss-net.web-method * @jboss-net.wsdd-operation * @ejb.interface-method view-type = "remote" */ public String[] testStringArray(){ String s[] = {"test","string"}; return s; }
... - <complexType name="ArrayOf_xsd_string"> - <complexContent> - <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" /> </restriction> </complexContent> </complexType> ... <wsdl:message name="testStringArrayRequest" /> ... - <wsdl:message name="testStringArrayResponse"> <wsdl:part name="testStringArrayReturn" type="impl:ArrayOf_xsd_string" /> </wsdl:message>
/** * @jboss-net.web-method * @jboss-net.wsdd-operation * @ejb.interface-method view-type = "remote" */ public int[] testIntArray(){ int i[] = {10,20,30}; return i; }
... int[] testint = stub.testIntArray(); Console.WriteLine(testint[0]); ...