1, first learn to deploy the environment, build AXIS2 environment. http://blog.csdn.net/lanqibaoer/article/details/22731291Now call an existing public WebService interface,
One, publish a webservice, the code is as follows Package Com.hoo.service; Public class Asynchronousservice { publicthrows interruptedexception{ // Let the current thread sleep 5 clock, show asynchronous call Thread.Sleep
Open CMD and run the following command.Set axis_lib = E: \ J2EE \ WebService \ Lib // set the Lib package required by axis2 WebServiceSet java_cmd = Java-djava. Ext. dirs = % axis_lib %Set output_path = D: // set the client code generation pathSet
There are some interface methods that need to be called by the partner company due to work needs. Adjusted for an afternoon before the tune, write down, to make memo, no nonsense, direct code.Import Javax.xml.namespace.qname;import
1. What did HelloWorld do?
HelloWorld function is very simple, in the client input your name, in this case, ZJ. After the parameter is passed to the server, the processing will return name+ "helloworld!", in this case ZJ helloworld!
2. Server-side
In practical applications, not only do you need to use WebService to pass simple types of data, but sometimes you need to pass more complex data, which can be called composite types of data. Arrays and classes (interfaces) are more commonly used as
1. Develop Web service server side using Axis2 's underlying APIs
1.1 Create a WebService (named MyService)
There are two operations in the MyService, as shown below.
public void Ping (omelement element) {}//in-only mode. Just receive the
Today, using the Axis2 Wsdl2java command to generate the client encountered a problem.
Wsdl2java.bat-uri getfactorycode.wsdl-p com.abc.planning.wsclient.mes.client.tj-d adb-pn http_port-s-o c:/src
Generated client, anyway, no way to execute.
Some time ago in the development of a short message to send the Access function, involving the WebServices interface of the call and be called. Below is a record of the steps of the AXIS2 Spring Integration Development webservices (assuming that the
The webservice created by this method can be placed under the same project as the Web project.To create the WebService service, the required jar packages are as follows:Axiom-api-1.2.8.jarAxiom-impl-1.2.8.jarAxis-0.1.jarAxis2-adb-1.5.jarAxis2-kernel-
1. Use cxf for server release, and use axis2 xmlbean to generate a client. This method is not safe enough to handle it.
2. Convert all complex types into custom objects and object arrays. For example, if the original returned list is
To summarize the lesson, Axis2client calls the WS interface when the URL cannot be added to the WSDL, and when called with CXF, it is added.Today with Axis2 rpcserverclient invoke HTTPS WebService interface, after setting the option parameter is
Or use my Blog "WebService study notes, Axis2 transfer simple objects, non-stub mode"Example of:First Build Servicetest.java
Package sample.ws.service;
Import Sample.ws.pojo.Person;
public class Servicetest {/*** Very simple we'll just send the
The "Apache Axis web services development step by step" written on the Internet by -- hubieshavip -- is followed.
Thanks very much to Hu Bisi, who wrote a lot of details.However, my environment is not the same as the one in his text, so I rewrite it
I. Use JDK Web Service APIs. Here we use a web service based on SOAP message.
1. Create a web services endpoint: Package hello;
Import javax. JWS. WebService;
Import javax. JWS. webmethod;
Import javax. xml. ws. endpoint;
@ WebServicePublic class
Document directory
Compile the services. xml file used to deploy a single service
Service name
Service Description
Service-level Parameters
Service
Service-level Message Receiver
Modules
Service session Scope
Service target namespace
Everything was hard at the beginning, and it took a day for it. Write this article for yourself and for others.
1. Install JDK 6And set the environment variables java_home, path, ClassThe installation path in this article is: D: \ tools \
Eclipse + axis2 + tomcat5.5 develop WebService
This article is originalJava. If you need to reprint it, please indicate the sourceHttp://www.javadrink.cnRecently used axis2DevelopmentWebService is a little complicated to build the
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.