1

I'm doing some tests with Axis2 java2wsdl tool, creating little simple web services.

The first I created has a simple add method with two floats as input. The java2wsdl command created the WSDL document with no problem. Next I created another service with a method that returns a String array but I had problems with the WSDL datatypes that the tool generated:

java2wsdl generates :

`<xs:element minOccurs="0" name="return" nillable="true" type="xs:anyType"`/>

And with soapUI client I got the error: "Can't serialize type"

I modified it "by hand" to:

<xs:element maxOccurs="unbounded" name="return" type="xs:string"/> 

And it worked.

The java source code is:

package Base;

public interface Base
{
 public String[] getNames();    
}

So, I don't understand why the tool did that mapping (String[] to xs:anyType)

Is there a special way that the java code must be written so java2esdl from axis2 creates the correct datatypes?

Thanks.

4

1 回答 1

1

如果您将类型指定为 xs:anyType,那么您需要使用 xs:type 属性在输入消息中提供确切的 XSD 类型,否则无法识别传入消息的类型。这可能对您有所帮助http://ssagara.blogspot.com/2011/07/how-to-get-best-use-of-axis2-object.html

于 2012-04-26T11:35:40.393 回答