users@jax-ws.java.net

Re: Exporting whole package in WSDL

From: Dinko Tenev <dinko.tenev_at_gmail.com>
Date: Mon, 6 Mar 2006 19:02:14 +0200

Just to make it clear, I have something like the following:


package types;

public abstract class A {}
public class B extends A {}
public class C extends A {}

public class D { A[] values; }


package svc;

@WebService
class Svc {
    public void foo( D data ) {}
}


The point is having a mixture of B and C objects in D.values.
Unfortunately, the schema generated for Svc.foo() only mentions D and
A. What I want to do is force definitions for B and C into the schema
as well, so that those could be available at the client side too.

I would be perfectly happy to do this by explicitly annotating B and
C, or by intercepting schema generation to produce the schema myself,
or just anything short of littering the Svc interface with dummy
methods, for that matter.

Any ideas will be greatly appreciated.


On 3/6/06, Dinko Tenev <dinko.tenev_at_gmail.com> wrote:
> Is there a way to have the WSDL definition for a service describe each
> and every class present in a package?
>
> I expected that annotating the package with @XmlSchema(...) would be
> enough, but the generated WSDL only mentions classes that are directly
> referenced from the exported interface. This is not what I want, as I
> need to export a whole hierarchy of which the interface mentions only
> a few base classes.
>
> What's the proper way to do this?
>
>
> Cheers,
>
> Dinko
>


--
Cheers,
    Dinko