Pojo axis2 WebService release

Source: Internet
Author: User

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 ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.