This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!

Flo Hum

Greenhorn
+ Follow
since Sep 01, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Flo Hum

Thanks Amit.
The WSDL I posted was generated by Axis2. I was merely trying to return the PolygonDataType POJO. I had tried to expand that WSDL and define the complex types as I recognized that was the problem, but when I set the useOriginalwsdl parameter to true in the services.xml, the web service completely broke.

I'll give it a another shot. Perhaps when using your own WDSL, instead of letting Axis2 auto-generate on the fly, the PolygonDataType must implement org.apache.axis2.databinding.ADBBean???
8 years ago
Hi Amit, thanks for willing to take a look.
The java class for the web service only has 2 public methods to simplify things. The {PolygonDataType} would correspond to the {MyData} class in the original post.

8 years ago
Hi there.
I can't figure out how to get my a simple Axis2 v1.5 POJO web service to work (Tomcat 6).
Included is some simplified code below to see the "nested classes" - they are not internal classes.
I'm not returning an Object anywhere, the Classes are defined. I initially had List members
instead of using arrays thinking that may have been the problem - didn't make a difference.
Is Axis2 just incapable of returning a class object that has a member that is an array of another class type?
I know that WSDL first is preferred but that learning curve is a bit too steep at the moment.
Any help is appreciated.

public class MyWebService {
public getMyData (String filter) {
/* This one doesn't work. Looking at the wsdl, the response is a generated defined type
<xs:element minOccurs="0" name="return" nillable="true" type="ax24:MyData"/>
However, the wsdl doesn't define the MyData type properly.
xs:complexType name="MyData">
<xs:sequence>
<xs:element minOccurs="0" name="areagroup" nillable="true" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
*/

MyData result;
blah, blah....
return result;
}

public PointDef[] getPointDef(String filter) {
// This works. The wsdl has the complexType defined correctly for the PointDef class type.
PointDef[] result;
blah, blah....
return result
}

public Areagroup[] (String filter) {
/* This one doesn't work either. The wsdl defines the Areagroup type, but once again the array
of Area classes ends up as xs:anyType. Though the Precision class type ends up being defined properly.
*/

MyData result;
blah, blah....
return result.aryAreagroup;
}
}

public class MyData {
protected Areagroup[] aryAreagroup;
}

public class Areagroup {
protected int areagroupId;
protected String areagroupName;
protected Precision precision;
protected Area[] aryArea;
}

public class Precision {
protected int precisionCd;
protected String precisionDesc;
}

public class Area {
protected int areaId;
protected String areaName;
protected PointDef[] aryPointDef;
}

public class PointDef {
protected int ordinal;
protected double latitude;
protected double longitude;
}
8 years ago