Question

I have written a SOAP service with Metro on Tomcat. It works fine but the class is not returned in full.

I have a class ServiceReport which has relationships with other classes. This is the code:

@Entity
@Table( name = "ALBAU_SERVICEREPORT" )
public class ServiceReport extends StoredEntity<ServiceReport> {

   @ManyToOne( targetEntity = AlbauInstallation.class, cascade = CascadeType.PERSIST )
   @XmlTransient
   private AlbauInstallation installation;

   @OneToOne( cascade = CascadeType.ALL )
   private FlexDocument flexDocumentData;

   //   private Header headerData;
   @OneToMany( cascade = CascadeType.ALL,
               fetch = FetchType.EAGER,
               targetEntity = Position.class,
               mappedBy = "serviceReport" )
   private List<Position> positionList;

The only property which is created in the WSDL is flexDocumentData. What annotations do I need in order to have both AlbauInstallation and positionList in the generated interface?

this is the link to the WSDL: http://alpha.sertal.ch:8181/VisionWeb/soap/AlbauInterface?wsdl

It looks like the OneToOne relationships are passed and the others are not

Était-ce utile?

La solution

In this case, it appears that the solution was quite simple:

In the class Position I changed the ManyToOne annotation as follows: form:

@ManyToOne
private ServiceReport serviceReport;

to:

@ManyToOne(targetEntity = ServiceReport.class)
private ServiceReport serviceReport;

the second change that was needed, was to add a setter for positions. I don't know why but without a setter the property does not appear in the WSDL.

and now I get the collection in the WSDL

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top