geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan <>
Subject Re: How to marshal/unmarshal HandlerType correctly ?
Date Tue, 24 May 2011 14:39:19 GMT
I just committed some changes to trunk at revision: 1127089. Current
solution is to use a XmlAdapter to create the QName even if it is
illegal. Now, it is OK to unmarshal the XML file, but while
marshalling the object to XML texts, those namespace information is
lost ...
Not sure whether there is better way for this.

2011/5/23 Ivan <>:
> Hi,
>    In the HandlerChain class of the jee module, we uses QName for the
> type of serviceNamePattern and portNamePattern for better access (By
> default, String type is used in the generated classes). But in the web
> service spec, it is allowed to specify * and invalid name space
> prefix.
>    e.g.
>     <handler-chain>
>              <service-name-pattern
> xmlns:ns1="">foo:HelloService</service-name-pattern>
>              ......
>     </handler-chain>
>    Now, while parsing the DD above, an exception like
> java.lang.IllegalArgumentException: prefix foo is not bound to a
> namespace is thrown.
>    Is there a way in JAXB to create a QName even the name space is
> invalid ? I am thinking to have a XMLAdapter to do this from String,
> but seems no way to look up the namespace by the prefix.
>    Thoughts ? Thanks.
> --
> Ivan


View raw message