So this is assuming you are starting from Java ? Because if you're
starting from WSDL then you probably shouldnt
need to do custom marshalling/unmarshalling.
Have you looked at
https://jaxb.dev.java.net/nonav/jaxb20-pfd/api/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html
A sample is included in the JAXB distribution in samples\j2s-xmlAdapter
There is also a similar discussion here
https://jaxb.dev.java.net/servlets/ReadMsg?list=users&msgNo=5620
/s
Kaleb Pederson wrote:
>Hello,
>
>I'm just starting out with web services using JWSDP and am trying to
>figure out how to marshall data that JAXB doesn't recognize by default.
>I guess that this really falls into two different questions.
>
>1) How can I tell the web service that this object type has a custom
>marshaller?
>
>2) Are there any restrictions that I need to be aware of when I write
>the marshaller?
>
>Here is an example of (1):
>
>import java.security.SecureRandom;
>public class MyObject {
> public SecureRandom r;
>}
>
>Now, say that I want to send this across the to the client after it's
>been marshalled.
>
>I can probably come up with a mapping from the SecureRandom object to
>XML (maybe just carry the seed across or something) and vice-versa, but
>I'm not sure how to integrate that directly with JAX-WS (or do I have to
>send it across as a string and then have the client stub manually
>unmarshall it)?
>
>I hope I'm not too far off on the wrong track, but if I am, please point
>me in the right direction.
>
>Thanks.
>
>--Kaleb
>
>