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 fa...@uniserv.com on 2011/05/05 11:14:56 UTC
Problem with automatically generated WSDL and nested classes
Hello,
the automatically generated WSDL does not contain the "type" attribute
for the element which corrsponds to the nested class.
My Java class looks like:
package com.uniserv.nested.test;
public class NestedClass {
public static class InnerStruct{
private String x;
private String y;
public InnerStruct(){
x= "";
y= "";
}
public String getX(){
return this.x;
}
public String getY(){
return this.y;
}
public void setX(String x){
this.x = x;
}
public void setY(String y){
this.y = y;
}
}
public class Output{
private InnerStruct[] innerStructArray;
public Output() {
innerStructArray = null;
}
public InnerStruct[] getInnerStructArray(){
return this.innerStructArray;
}
public void setInnerStructArray (InnerStruct[]
innerStructArray){
this.innerStructArray = innerStructArray;
}
}
public Output testIt (String a ){
Output output = new Output();
InnerStruct[] innerStructArray =
output.getInnerStructArray();
if(innerStructArray == null){
innerStructArray = new NestedClass.InnerStruct[2];
InnerStruct struct1 = new NestedClass.InnerStruct();
struct1.setX("x1");
struct1.setY("y1");
innerStructArray[0]= struct1;
InnerStruct struct2 = new NestedClass.InnerStruct();
struct2.setX("x2");
struct2.setY("y2");
innerStructArray[1]= struct2;
}
output.setInnerStructArray(innerStructArray);
return output;
}
}
The automaticaly generated WSDL contains following:
- <wsdl:types>
- <xs:schema xmlns:ax210="http://test.nested.uniserv.com/xsd"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://test.nested.uniserv.com">
<xs:import namespace="http://test.nested.uniserv.com/xsd" />
- <xs:element name="testIt">
- <xs:complexType>
- <xs:sequence>
<xs:element minOccurs="0" name="a" nillable="true"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="testItResponse">
- <xs:complexType>
- <xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true"
type="ax210:Output" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
- <xs:schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://test.nested.uniserv.com/xsd">
- <xs:complexType name="Output">
- <xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0"
name="innerStructArray" nillable="true" />
</xs:sequence>
</xs:complexType>
- <xs:complexType name="InnerStruct">
- <xs:sequence>
<xs:element minOccurs="0" name="x" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="y" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
The definition of the complexType Output does not contain the type of
the particular elements:
<xs:element maxOccurs="unbounded" minOccurs="0" name="innerStructArray"
nillable="true" />
I would expect to see
<xs:element maxOccurs="unbounded" minOccurs="0" name="innerStructArray"
nillable="true" type="ax210:InnerStruct" />
I can specify my own WSDL and it does function, but I would like to use
the automatically generated one.
How can I influence axis2 to generate correct WSDL?
Thank you,
Fadila
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org