You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by St...@astrazeneca.com on 2005/12/12 15:39:51 UTC
.net string array
Hi!
I'm a bit confused...
Below you can see the WSDL I'm using. Basically I just copied the example
from dinoch and removed everything except the array of strings, to see if I
could get it to work with .Net.
I generated java files using wsdl2java using the wsdl bellow, compiled and
deployed them into axis, ans tested it with a client java class.
The code works fine in Java using:
public void call()throws Exception{
Array_string anrop = port.getArrayOfString("jfjjdh");
String[] result = anrop.getItem();
System.out.println(result[0]);
System.out.println(result[1]);
System.out.println(result[2]);
System.out.println(result[3]);
}
But when testing in .Net, the returned array is empty,
GetArrayOfString("caller") returns a void array...
What am I doing wrong?
Please help!!!
/Stefan
<?xml version="1.0" encoding="utf-8"?>
<!-- IBasics.wsdl -->
<!-- -->
<!-- defines a web services interface for a basic service. -->
<!-- This one has 2 methods, one that returns an array of -->
<!-- String, the other returns an array of float. -->
<!-- Both methods accept nothing as input params. -->
<!-- -->
<!-- Mon, 26 Jul 2004 17:00 -->
<!-- -->
<definitions
xmlns = "http://schemas.xmlsoap.org/wsdl/"
targetNamespace = "http://example.org/webservices/"
xmlns:s0 = "http://example.org/webservices/"
xmlns:soap = "http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s = "http://www.w3.org/2001/XMLSchema"
>
<types>
<s:schema elementFormDefault="qualified"
targetNamespace="http://example.org/webservices/">
<s:element name="GetArrayOfString">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="caller"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetArrayOfStringResult">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="item"
type="s0:Array_string" />
</s:sequence>
</s:complexType>
</s:element>
<!-- this WSDL artifact is not WS-I BP1.0 compliant, but is necessary
to enable AXIS to serialize properly -->
<s:complexType name="Array_string">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="item"
type="s:string" />
</s:sequence>
</s:complexType>
</s:schema>
</types>
<message name="GetArrayOfStringSoapIn">
<part name="parameters" element="s0:GetArrayOfString" />
</message>
<message name="GetArrayOfStringSoapOut">
<part name="parameters" element="s0:GetArrayOfStringResult" />
</message>
<portType name="BasicServiceSoap">
<operation name="GetArrayOfString">
<documentation>Method that returns an array of String</documentation>
<input message="s0:GetArrayOfStringSoapIn" />
<output message="s0:GetArrayOfStringSoapOut" />
</operation>
</portType>
<binding name="BasicServiceSoap" type="s0:BasicServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<operation name="GetArrayOfString">
<soap:operation
soapAction="http://example.org/webservices/GetArrayOfString"
style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<!-- service name becomes the name of the proxy class on the client side
(.NET) -->
<service name="StringReturnStefan">
<!-- port name becomes the name used in the URL on the AXIS/server side.
-->
<port binding="s0:BasicServiceSoap" name="Basics">
<soap:address
location="http://seso-odx224225emea.astrazeneca.net:8080/axis/services/Basic
s"/>
</port>
</service>
</definitions>