I just tried deploying my services using the RC2 jars. The wsdl is generated dynamically a the url and I use this wsdl to generate (RC2) wsdl2java client stubs.
The SOAP request/response on the wire seems to be fine. The client stub for the TestResponse element also seems to reflect the schema element.
However, on the client side, I get the fol. RuntimeException:
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement
products
at com.test.services.Powerservices2Stub.fromOM(Powerservices2Stub.java:5401)
at com.test.services.Powerservices2Stub.getProducts(Powerservices2Stub.java:149)
at Test.main(Test.java:26)
According to the wsdl and my server side java code, this element is perfectly valid in the SOAP response. Is this a potential bug on the client side deserialization?
My wsdl parts looks like this:
<xs:complexType name="TestResponse">
<xs:sequence>
<xs:element name="applicationKey" nillable="true" type="xs:string"/>
<xs:element maxOccurs="unbounded" name="products" nillable="true" type="ax21:Product"/>
</xs:sequence>
</xs:complexType>
and the corresponding client stub code looks like this:
public static class TestResponse implements
org.apache.axis2.databinding.ADBBean {
/* This type was generated from the piece of schema that had
name = TestResponse
Namespace URI = http://dataobjects.test.com/xsd
Namespace Prefix = ns1
*/
/**
* field for ApplicationKey
*/
protected java.lang.String localApplicationKey;
/**
* Auto generated getter method
* @return
java.lang.String
*/
public java.lang.String getApplicationKey() {
return localApplicationKey;
}
/**
* Auto generated setter method
* @param param ApplicationKey
*/
public void setApplicationKey(java.lang.String param) {
this.localApplicationKey = param;
}
/**
* field for Products
* This was an Array!
*/
protected Product[] localProducts;
/**
* Auto generated getter method
* @return Product[]
*/
public Product[] getProducts() {
return localProducts;
}
/**
* validate the array for Products
*/
protected void validateProducts(Product[] param) {
if ((param != null) && (
param.length < 1)) {
throw new java.lang.RuntimeException();
}
}
- Re: Axis2: doc/lit client stubs S Pole
- Re: Axis2: doc/lit client stubs Thilina Gunarathne
