Hi all. I am having trouble defining my WebService as I want it.
Below is a sample how I want the XML to look like when I send it:
<com:findProducts>
<catalog>myCatalog</catalog>
<attributes>
<attribute>
<name>?</name>
<value>?</value>
</attribute>
<attribute>
<name>?</name>
<value>?</value>
</attributes>
</attributes>
</com:findProducts>
But after generating from my annotated Java files, I get a contract that
defines the XML like the following:
<com:findProducts>
<catalog>myCatalog</catalog>
<attributes>
<name>?</name>
<value>?</value>
</attributes>
<attributes>
<name>?</name>
<value>?</value>
</attributes>
</com:findProducts>
The important Java files are as follows:
@WebService(targetNamespace = ".....")
public interface ProductService
{
public ProductListBean findProducts(
@WebParam(name = "catalog") String catalog,
@WebParam(name = "attributes")
List<AttributeNameValueBean> attributes);
and
@XmlRootElement(name = "attribute")
public class AttributeNameValueBean
{
private String name;
private String value;
@XmlElement(name = "name",required=true)
public String getName()
{
return name;
}
I thought that defining the list as "attributes" and the
AttributeNameValueBean as "attribute" would get me what I want. But
apparently not. Anybody got an idea of how to do it differently?
Regards,
Magnus
--
View this message in context:
http://www.nabble.com/Getting-lists-as-I-want-them...--tp22725382p22725382.html
Sent from the cxf-user mailing list archive at Nabble.com.