i have a couple of question regarding JAX-WS.
What is the functionality of object Factory generated using wsimport ? How does it relate to web service architecture ?
I have web service Service endpoint implementation class written by me with the method signature like this :
view plaincopy to clipboardprint?
@WebMethod(operationName = "deleteOrder")
@Oneway // No return value
public void deleteOrder(@WebParam(name = "myCustorder") Custorder myCustorder) {
myCustOrder.deleteOrder(myCustorder);
}
The parameter for the Custorder is derived from database where the package is Entity.Custorder but when i used the wsimport to generate the JAXB Mapped class, it has different type which is ServiceClient.Custorder.
On top of that, I drag and drop the service client invocation using netbeans IDE and with this method signature.
view plaincopy to clipboardprint?
private int createOrder(ServiceClient.Custorder myCustorder) {
ServiceClient.OrderWebService port = service.getOrderWebServicePort();
return port.createOrder(myCustorder);
}
As far as i know, the @WebParam annotation is used to automatically convert the SOAP message to java object. Therefore, I wonder which one (ServiceClient.Custorder or Entity.Custorder) to use in the service endpoint implementation signature.
If i use the ServiceClient.Custorder (JAXB generated), then how to convert to Entity.Custorder (JPA generated) ?
From my experience, i have developed RESTFul web service with entity class which can convert to xml and mapped to database table. Previous, i using @XMLRootElement and @Entity
How to implement a POJO which can convert to XML and database entity in JAX-WS ?
How to relate the annotation in Java to wsdl standard ? Any tutorial that explain wsdl elements with Java annotation mapping ?
How does this createOrder.java generated using wsimport related to SOAP message ?
view plaincopy to clipboardprint?
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "createOrder", propOrder = {
"myCustorder"
})
public class CreateOrder {
protected Custorder myCustorder;
/**
* Gets the value of the myCustorder property.
*
* @return
* possible object is
* {@link Custorder }
*
*/
public Custorder getMyCustorder() {
return myCustorder;
}
/**
* Sets the value of the myCustorder property.
*
* @param value
* allowed object is
* {@link Custorder }
*
*/
public void setMyCustorder(Custorder value) {
this.myCustorder = value;
}
}
What is client invocation flow to web service endpoint (service endpoint implementation) for JAX-WS web service ?
As far as i know, there are couples of methods to invoke web service implementation.
- Stubs code
Extends service class The @WebServiceReference is used to find the web service using UDDI. Used service.getServicePort proxy to call the interface exposed by Service endpoint implementation. Is this correct and any other explanation ?
- Proxy
- JAX-WS Dispatch API
What is the difference between all these ? How does this relate to the web service architecture ?
Please help me.
Thanks.