How can I keep XML Schema types in WSDL after using XmlAdapter wrappers in web services?
Issue
- When using the
package-info.javaon our package level classes, we created aDateAdapter,BooleanAdapter, andLongAdapterwrapper classes. - For instance, the
LongAdapterclass is as follows:
public class LongAdapter extends XmlAdapter<String, Long> {
@Override
public Long unmarshal(String value) throws Exception { ... }
@Override
public String marshal(Long value) throws Exception { ... }
}
- This worked, but we noticed that the WSDL that is generated converted the previous
Date,Long, andBooleandata types in the WSDL toString. - We wanted to know if we can retain the previous data types from before. Is there another approach to keep the data types intact?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 5.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
