Hi Raymond, I added the annotation to an interface method like this:
@DataType(name = "javax.xml.bind.JAXBElement", context = { @DataContext(key
= "jaxb.contextPath", value = "foo.jaxb") })
void foo(FooType fooType);
However, the NPE still occurred as before. Not sure whether I miss anything,
but I don't figure out how you put the metadata defined in annotation into
DataType, and it was still "null" through calling DataType.getMetaData() in
JAXBContextHelper. I just saw the metadata was put into service contract or
operation and I could print it out at runtime. Would you please clarify?
In addition, I am curious about why the JAXB configuration should be defined
using annotation while the SDO stuff is defined in SCDL? I feel they could
both be global configuration in a composite? And specifying @DataContext on
each individual interface or operation is an ugly work if they have the same
set of packages?
Also, could it be possible to do automatic detection for the
contextPath/classes? For example, when introspecting interface or operation
annotated with JAXB DataType annotation, is it feasible to directly add
package names of the parameters and return value to contextPath if they are
of complex types?
Thanks!
Li
> -----Original Message-----
> From: Raymond Feng [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 18, 2006 7:40 AM
> To: [email protected]
> Subject: Re: Question on JAXB data binding
>
> Hi,
>
> When you annote the java interface with JAXB binding, you can set extra
> context as @DataContext(key="...", value="...").
>
> Can you give that a try?
>
> Thanks,
> Raymond
>
> ----- Original Message -----
> From: "Li Shen" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Tuesday, October 17, 2006 12:06 AM
> Subject: Question on JAXB data binding
>
>
> > Hi Raymond,
> >
> > How can I specify the "contextPath" or "classes" when using JAXB data
> > binding in binding.ws? Without them NPE was thrown from the code below
> > since
> > JAXBContext does not allow pass null to newInstance():
> >
> > String contextPath = (String)
> > bindingContext.getMetadata(JAXB_CONTEXT_PATH);
> > JAXBContext context = null;
> > if (contextPath != null)
> > context = JAXBContext.newInstance(contextPath);
> > else {
> > Class[] classes = (Class[]) bindingContext.getMetadata(JAXB_CLASSES);
> > context = JAXBContext.newInstance(classes);
> > }
> >
> > In your test code, I saw you used this:
> >
> > targetDataType.setMetadata(JAXBContextHelper.JAXB_CONTEXT_PATH,
> > contextPath);
> >
> > But how can I configure it when using binding.ws? Or you can do
automatic
> > detection?
> >
> > Thanks!
> >
> > Li
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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]