Well I tried to build a web service returning a JFrame... isn't that the cool thing about Java reflexion / serialization.....
SEVERE: Cannot initialize endpoint : error is :
javax.xml.ws.WebServiceException: Unable to create JAXBContext
Blah blah
Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 21 counts of IllegalAnnotationExceptions
java.awt.LayoutManager is an interface, and JAXB can't handle interfaces.
Well the least I can say, making Swing and Server based Java is not always simple...
Showing posts with label soap. Show all posts
Showing posts with label soap. Show all posts
Friday, July 16, 2010
Thursday, July 15, 2010
My solution to the XmlID XmlIDREF and the object graph reconstruction
At the previous stage, I stopped with a situation where I could get an entity (a patient) but nothing about a related entity (a doctor). The reason being that to break the serialization loop I used the XmldID and XmlIDREF annotations.
In the soap response I can see the doctor id (2). In Java the doctor field of the patient points to null (because as shown in the previous post, the doctor is not transfered).
By the way in Open ERP I would get not the doctor but at least the in id in the Python object. One more shame on Oracle/Sun stuff.
Anyway, I created another web service that does not return a single patient record but a compound of entities (a collection of patients and doctors) :
public class wsbr {
private Collection patientCollection;
private Collection doctorCollection;
public Collection getPatientCollection() { return patientCollection ;};
public void setPatientCollection(Collection p ) { patientCollection = p;};
public Collection getDoctorCollection() { return doctorCollection ;};
public void setDoctorCollection(Collection p ) { doctorCollection = p;};
}
Building a web service that returns such object and populating properly the two collection makes possible to transfer the entire graph which is rebuilt properly at the client side (automatically).
Here is the soap :
So my solution is to build a big compound referencing object that will ensure that all references will be carried properly.
In the soap response I can see the doctor id (2). In Java the doctor field of the patient points to null (because as shown in the previous post, the doctor is not transfered).
By the way in Open ERP I would get not the doctor but at least the in id in the Python object. One more shame on Oracle/Sun stuff.
Anyway, I created another web service that does not return a single patient record but a compound of entities (a collection of patients and doctors) :
public class wsbr {
private Collection
private Collection
public Collection
public void setPatientCollection(Collection
public Collection
public void setDoctorCollection(Collection
}
Building a web service that returns such object and populating properly the two collection makes possible to transfer the entire graph which is rebuilt properly at the client side (automatically).
Here is the soap :
So my solution is to build a big compound referencing object that will ensure that all references will be carried properly.
Subscribe to:
Posts (Atom)