Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Netbeans/wsgen Abstract class problem

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am attempting to create a web service with nb 7.2.0, using the built-in ant wsgen functionality.

The web service takes an object of abstract class as a parameter.
I have annotated the abstract class with @XmlSeeAlso({concreteClass1.class, concreteClass2});
I have also annotated the web service class with @XmlSeeAlso({concreteClass1.class, concreteClass2});

But when wsgen runs, I never get the concrete classes put into the generated .xsd, just the abstract class.

What am I doing wrong here?

 
John Farrel
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've tried simplifying this to the basic case.
The generated schema does not include Dog and Cat.


@XmlSeeAlso({Dog.class, Cat.class})
@WebService(serviceName = "UtbTest")
public class UtbTest
{

/**
* This is a sample web service operation
*/
@WebMethod(operationName = "getAnimal")
public Animal getAnimal(@WebParam(name = "animal") Animal animal)
{
return animal;
}
}

public abstract class Animal
{
public abstract String getName();
}

public class Cat extends Animal
{
@Override
public String getName()
{
return "cat";
}
}

public class Dog extends Animal
{
@Override
public String getName()
{
return "dog";
}
}






 
John Farrel
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

So, no-one has any idea what the problem is.
Damn.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic