tags:

views:

45

answers:

0

Hi!

I have a web service:

@WebMethod
public TimeEntry getTimeEntry() {
  return dummyTimeEntry;
}

where

public static class TimeEntry implements Serializable {
  private Date date;
  private String costCenter;
  private String description;
  private BigDecimal hours;

  /**
   * @see java.lang.Object#toString()
   */
  @Override
  public String toString() {
    return Utils.toCommaDelimitedString(super.toString(), date, costCenter,
        description, hours);
  }
  /**
   * @return the date
   */
  public Date getDate() {
    return date;
  }
  /**
   * @param date the date to set
   */
  public void setDate(Date date) {
    this.date = date;
  }
  /**
   * @return the costCenter
   */
  public String getCostCenter() {
    return costCenter;
  }
 /**
   * @param costCenter the costCenter to set
   */
  public void setCostCenter(String costCenter) {
    this.costCenter = costCenter;
  }
  /**
   * @return the description
   */
  public String getDescription() {
    return description;
  }
 /**
   * @param description the description to set
   */
  public void setDescription(String description) {
    this.description = description;
  }
  /**
   * @return the hours
   */
  public BigDecimal getHours() {
     return hours;
  }
  /**
   * @param hours the hours to set
   */
  public void setHours(BigDecimal hours) {
    this.hours = hours;
  }
  /**
   * @param task, date
   * @return TimeEntry
   */
  public static TimeEntry of(Date date, String entry, BigDecimal hours) {
    TimeEntry timeEntry = new TimeEntry();
    timeEntry.setCostCenter(entry);
    timeEntry.setDate(tdate);
    timeEntry.setDescription(entry);
    timeEntry.setHours(hours);
    return timeEntry;
  } 
}

I get exception:

2010-08-23 10:15:39,065 7324109 [17888542@qtp-7375243-131] ERROR Message  - java.io.IOException:
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.io.IOException: No serializer found for class TimeReportService$TimeEntry in registry    org.apache.axis.encoding.TypeMappingDelegate@17a79dd
 faultActor:
 faultNode:
 faultDetail:
   {http://xml.apache.org/axis/}stackTrace:java.io.IOException: No serializer found for class    TimeReportService$TimeEntry in     registry org.apache.axis.encoding.TypeMappingDelegate@17a79dd
   at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1507)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:734)
   at org.apache.axis.encoding.ser.ArraySerializer.serialize(ArraySerializer.java:414)
   at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)

How can I @Annotate a BeanSerializer or similar? Because this is jax-ws I don't want to spend time configuring in XML. My server-config.wsdd looks like:

 <service name="timeReportService" style="wrapped" use="literal">
  <parameter name="className" value="xxx.TimeReportService"/>
 </service>

It worked fine before I added this new method with Complex data type TimeEntry. I have googled about it and sources say I should use BeanSerializer, but at the same time I cannot find how to annotate that.