0
votes

i have a couple of question regarding JAX-WS.

  1. What is the functionality of object Factory generated using wsimport ? How does it relate to web service architecture ?

  2. 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 ?

  1. How to relate the annotation in Java to wsdl standard ? Any tutorial that explain wsdl elements with Java annotation mapping ?

  2. 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;  
    }  

} 
  1. What is client invocation flow to web service endpoint (service endpoint implementation) for JAX-WS web service ?

  2. As far as i know, there are couples of methods to invoke web service implementation.

  3. 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 ?

  1. Proxy
  2. JAX-WS Dispatch API

What is the difference between all these ? How does this relate to the web service architecture ?

Please help me.

Thanks.

1
Way too many questions. You need to break this down and ask one or two in your post.drekka
Sorry about that. Let focus on the first and second question. Thanks.nicholas
Can anyone provide help on second question ?nicholas

1 Answers

0
votes

There are two approaches to invoke web service:

  1. Proxy Stub code
  2. Dispatch API