Hi John,

I haven't tried out the Axis2 POJO support, but in general anything you do using POJOs directly is going to be both inflexible and very limited in terms of the XML support. You might want to look into using JiBX data binding, which will provide full XML support for existing POJO classes while also offering a lot more flexibility. The Jibx2Wsdl tool (http://www.sosnoski.com/jibx-wiki/space/axis2-jibx/jibx2wsdl) can be used to generate the full set of artifacts for this, including a JiBX binding, the corresponding XML schema, and the WSDL.

If you're using Java 5+, you might also be able to use JAXB annotations in your POJOs to achieve the same results (or does that change these to POAJOs, Plain Old Annotated Java Objects?). I know there's some basic support for JAXB in the Axis2 1.2 release. I don't know if this allows you to work with existing JAXB-annotated classes, or if you always have to generate your classes. JAX-WS support would definitely allow this, but from what I know that's still at an experimental stage.

 - Dennis

--
Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



John G. Norman wrote:
dims,

Thanks. I'll look into that and will get back to the list and/or Jira tomorrow.

Note that I am trying to avoid tweaking the WSDL at all costs. The
value of the POJO stuff lies in not having to do that . . .

John

On 5/23/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote:
It seems like the schema in the wsdl might need a tweak as the adb
generated code is expecting at least 1. could you try saving the wsdl
and tweaking the schema (minOccurs/maxOccurs) and then codegen using
the tweaked wsdl. If you make no headway, please log a bug with your
javabean/wsdl etc.

thanks,
dims

On 5/23/07, John G. Norman <[EMAIL PROTECTED]> wrote:
> Thanks, dims.
>
> I'm returning an array of javabeans. So it's like:
>
> return new Thingy[0];
>
> (Returning many of them is fine; returning one of them is fine.)
>
>
> On 5/23/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote:
> >
> > Say you are returning an array of strings...are you doing this?
> >
> > return new String[0];
> >
> > or this?
> >
> > return null;
> >
> > thanks,
> > dims
> >
> > On 5/23/07, John G. Norman < [EMAIL PROTECTED]> wrote:
> > > Hi.
> > >
> > > My Axis2 1.2 POJO service
> > > (http://ws.apache.org/axis2/1_2/pojoguide.html) can
> return
> > > an array of length 0.
> > >
> > > Does anyone know definitively if this will work with a vanilla client
> > > generated with org.apache.axis2.tool.ant.AntCodegenTask
> > > taking all of the defaults?
> > >
> > > (I.e., I'm trying to leverage as much of the auto-generated stuff as
> > > possible.)
> > >
> > > At present, my client is generating a runtime exception: unexpected
> > > subelement.
> > >
> > > Before I start going into this, if anyone has a proof case that a
> 0-length
> > > array can be successfully returned, I would appreciate it.
> > >
> > > I'm not going to paste in the XML 'cos I'm more concerned to know if
> anyone
> > > can confirm the successful case, before I start to debug.
> > >
> > >
> >
> >
> > --
> > Davanum Srinivas :: http://davanum.wordpress.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>


--
Davanum Srinivas :: http://davanum.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to