简体   繁体   中英

JAX-WS Question

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.

There are two approaches to invoke web service:

  1. Proxy Stub code
  2. Dispatch API

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM