One of my WebParams has a HashMap in it and so I've annotated the field with
@XmlJavaTypeAdapter and created an XmlAdapter for it. The java generated
from the WSDL has a field that's listed in that Adapter along with a
"HashMap" that extends "AbstractMap", both in my namespace.
The "HashMap" object has getters and setters based on the fieldName while
the holder object for a List of my Entries is based on the method name.
That is this class:
@XmlRootElement
public class AdRequest {
@XmlJavaTypeAdapter(QueryParametersAdapter.class)
private Map<String, String[]> m_queryParameters;
public Map<String, String[]> getQueryParameters() { ... }
public void setQueryParameters(Map<String, String[]> p_queryParameters) {}
}
Turns into this after wsdl2java:
public class AdRequest implements java.io.Serializable {
private mynamespace.HashMap m_queryParameters;
private mynamespace.AdRequestQueryParametersEntry[] queryParameters;
}
Where mynamespace.HashMap extends mynamespace.AbstractMap.
Marshalling and unmarshalling works fine with my Map<String,String[]> values
added via setQueryParameters(AdRequestQueryParametersEntry[]). I'm just
annoyed that this HashMap shows up.
I've tried to annotate with XmlAccessType set to PUBLIC_MEMBER (the default)
and PROPERTY but it hasn't helped me out.
If I change the field name in my original AdRequest to "queryParameters" I
get this error in my logs:
Class has two properties of the same name "queryParameters"
this problem is related to the following location:
at public java.util.Map
com.ladro.cxf.image.AdRequest.getQueryParameters()
at com.ladro.cxf.image.AdRequest
this problem is related to the following location:
at private java.util.Map
com.ladro.cxf.image.AdRequest.queryParameters
at com.ladro.cxf.image.AdRequest
which does make sense.
Has anyone else seen this? I've also tried marking the field as
XmlTransient but then JAXB ignores the getters and setters.
--
View this message in context:
http://www.nabble.com/%40XmlJavaTypeAdapter-with-HashMap-creates-two-fields-on-SOAP-object-tp16038742p16038742.html
Sent from the cxf-user mailing list archive at Nabble.com.