axis2 Generating the Service using XMLBeans

reference from Apache Axis2

Generating the Service using XMLBeans

To generate a service using XMLBeans, execute the following steps.

Generate the skeleton using the WSDL2Java utility by typing the following in the Axis2_HOME/samples/quickstartxmlbeans directory.

%AXIS2_HOME%\bin\wsdl2java -uri resources\META-INF\StockQuoteService.wsdl -p samples.quickstart.service.xmlbeans -d xmlbeans -s -ss -sd -ssi -o build\service

Else simply type ant generate.service in the Axis2_HOME/samples/quickstartxmlbeans directory.

The option -d xmlbeans specifies XML Beans data binding. The -s switch specifies synchronous or blocking calls only. The -ss switch creates the server side code (skeleton and related files). The -sd switch creates a service descriptor (services.xml file). The -ssi switch creates an interface for the service skeleton. The service files should now be located at build/service.

If you generated the code by using WSDL2Java directly, next you have to modify the generated skeleton to implement the service (if you used "ant generate.service", a completed skeleton will be copied over the generated one automatically).

Next open the build/service/src/samples/quickstart/service/xmlbeans/StockQuoteServiceSkeleton.java file and modify it to add the functionality of your service to the generated methods (see Code Listing 7).

你可能感兴趣的:(service)