[One-stop service] deployment WebService and startup scripts _webservice

Source: Internet
Author: User
Tags web services testng
In Java, when you create a WebService project, you typically use two components: Xfire and Jax-ws, which, depending on your needs, are likely to be used, recorded here.
In addition, when deployed to a production environment, that is, the way the jar package is exported, a startup script is needed to automatically load the dependent jar package to execute the program.       The Windows and Linux versions are shown below. This diagram is good to explain the JAX-WS process.


Process Spring+jax-ws 1, Spring configuration file: (Reference: Official Spring Integration sample) (1) registers the Jax-ws servlet (2) in Web.xml, then adds the header file, Handler to the spring configuration file, Service bindings and create Web Service Beans 2, Handler: (Reference: Official Handler Sample Oracle Official example) 3, Web Service Portal class
Learning results (pits encountered) 1, Handler Getheaders () returned a null value, easy to cause null pointer exceptions, so the recommended use of Collections.emptyset (). For the reasons please see the literature [3] 2, the second process in the previous section, Handler Out.println () replaced by Org.apache.log4j.Logger, convenient output log, in addition, Logtosystemout () method body, appropriate optimization of If-else, Change it. : ternary operator. Detailed code see Best Practices 1 3, Windows and Linux startup scripts. Sh and. bat
--------------------------------------------------May 23, 2014 update: Increase performance test for WebService----------------------1, JUnit used in unit testing before, but when it comes to stress testing and performance testing, you have to use testng, for reference: Use TESTNG for performance testing
Best practices 1, Handler download 2, Web Service class download 3, WebService client after Wsimport command generation 4, Windows startup Java Script download 5, Linux startup java script download
References [1]. Using the Xfire component to develop WebService instances: Explain the nature of webservice and illustrate
[2]. 5 days to learn Jaxws-webservice programming first day: Five to explain, including return list<object>, pictures, attachment upload.
[3]. Prefer empty items to null ones: explains why null values are replaced by empty collections
[4]. JAX-WS Wikipedia: Integrates all the resources of JAX-WS
[5]. Jax-ws annotation, such as @webresult explanation
[6]. Java Jax WS Tutorial Develop Web services Clients Consumers: detailed case for JAX_WS annotation
[7]. Creating a simple Web Service and Client with Jax-ws: From the official, the Java EE 5 Tutorial

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.