Pay attention to the following points when writing, releasing, and testing a WebService with 0 configurations:
1. The pojo class cannot use the package keyword to declare a package.
2. axis2 can hot publish WebService by default. That is to say, Tomcat can automatically publish WebService without restarting when the. Class file of WebService is copied to the pojo directory. To cancel the hot release of axis2, open the <tomcat installation directory> \ webapps \ axis2 \ WEB-INF \ conf \ axis2.xml and find the following configuration code:
<Parameter name = "hotdeployment"> true </parameter>
Change "true" to "false. Note that axis2 is a hot release by default, but it is not a hot update. That is to say, once a WebService is successfully released and you want to update the WebService, you must restart tomcat. This is inconvenient for developers to debug WebService. Therefore, axis2 can be set to hot update when developing WebService. In the axis2.xml file, find <Parameter
Name = "hotupdate"> false </parameter>. Set "false" to "true.
3. when testing WebService in a browser, if the WebService method has parameters, you need to use the URL request parameters to specify the value of the WebService method parameter. The request parameter name must be consistent with the method parameter name, determine the parameter name based on the wdsl file.
4. The pojo directory for WebService publishing is the default one. If you want to publish WebService in another directory, open the axis2.xml file and add the following sub-elements to the <axisconfig> element:
<Deployer extension = ". Class" directory = "my" class = "org. Apache. axis2.deployment. pojodeployer"/>
The above configuration allows you to publish WebService in the <tomcat installation directory> \ webapps \ axis2 \ WEB-INF \ My directory. For example, copying simpleservice. class in this example to the my directory can also be published successfully (but you need to delete simpleservice. Class in the pojo directory, otherwise WebService will be renamed ).