Hi all

First of all i dont understand why i have to map java types using aegis to
get rid of JAXBElement objects.
Isnt it possible to somehow read the known java types and add them to the
generated wsdl?

Well i am using the newest version of xfire 1.2.4 and i have made a simple
webservice to retrieve download
information. I am using straight forward java both for the interface and the
implementation. No annotations
is used here.

The server side is working fine and the wsdl it generated. My problem is
occurring when i am generating a
client using org.codehaus.xfire.gen.WsGenTask.
All data types is converted to JAXBElement. Even for simple string
properties.
Well I read on the gmane.comp.java forum that it was possible to get rid of
this object using aegis. So i
thought why not use annotations.

@XmlType
public class UserInfo {
   private String username;

   public UserInfo() {}

   @XmlAttribute
   public String getUsername() {
       return username;
   }

   public void setUsername(String username) {
       this.username = username;
   }
}

For the class above it was working perfectly. The JAXBElement object was
converted to a String. My problem
is regarding ArrayOfString.

@XmlType
public class DownloadInfo {
   private String[] siteIds;

   public DownloadInfo() {}

   @XmlElement
   public String[] getSiteIds() {
       return siteIds;
   }

   public void setSiteIds(String[] siteIds) {
       this.siteIds = siteIds;
   }
}

It seems like i have to use something else for this type because it is still
shown as JAXBElement<ArrayOfString>.
I have also tried to change the XmlElement with XmlAttribute and even added
a type. But still no affect. I know that
it is simple to retrieve the elements in the object above, but it could be
nice if the array was returned.

Hope that you can answer some of my questions.

Kind regards

/Murat Yücel

Reply via email to