How to use Axis WSDL2Java generated files?

前端 未结 2 1525
执念已碎
执念已碎 2021-02-05 05:01

I generated Java files from WSDL with WSDL2Java converter, but I don\'t know how can I use service with these files, because there are no examples. I\'m implementing client side

2条回答
  •  走了就别回头了
    2021-02-05 05:39

    Regarding Axis2: read these these links they contain some examples:

    http://ws.apache.org/axis2/1_5_1/quickstartguide.html#clients
    http://ws.apache.org/axis2/1_0/userguide3.html

    EDIT: Regarding Axis1: it is based on JAX-RPC and you need to instantiate stub object or use service locator to get stub instance and all WS operations will be in that. An example is given here:

    public class Tester {
      public static void main(String [] args) throws Exception {
        // Make a service
        AddressBookService service = new AddressBookServiceLocator();
    
        // Now use the service to get a stub which implements the SDI.
        AddressBook port = service.getAddressBook();
    
        // Make the actual call
        Address address = new Address(...);
        port.addEntry("Russell Butek", address);
      }
    }
    

提交回复
热议问题