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]