• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Axis2 POJO web service - wsdl generating xs:anyType

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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;
}
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please post the wsdl that is getting generated.

Regards,
Amit
 
Flo Hum
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Amit ChaudhariC
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Flo,

There seems to be an issue with the wsdl that you provided.
How are you generating the wsdl ?
I could generate the wsdl based on the source code provided in your first comment .
After that i generated the server side classes. I am pasting the sample below as i think this is what you are expecting.


I am pasting the relevant wsdl part for your reference which will help you.


Please check if that helps .

Please let me know if it works.

Regards,
Amit
 
Flo Hum
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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???
 
Willie Smits can speak 40 languages. This tiny ad can speak only one:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic