Java jdk:jdk1.5.0_17
Download URL: Http://pan.baidu.com/s/1gdmAkgV
Tomcat 6.0
: http://tomcat.apache.org/download-60.cgi
Axis1.3 (note Now that the version is already AXIS2, and we are using axis1.x here), axis1.x the operating environment requires less than jdk1.6 (not including jdk1.6), the Tomcat version is less than 6.0 (including 6.0):
: Http://pan.baidu.com/s/1gdmAkgV
With these files, not enough, we also need to download Activation.jar Mail.jar Soap.jar Xerces.jar (: Http://pan.baidu.com/s/1gdmAkgV) four packages and join in the user library
Environment parameter configuration:
axis_lib= D:\java\apache-tomcat-6.0.44\webapps\axis\WEB-INF\lib
axisclasspath=%axis_lib%\axis.jar;%axis_lib%\commons-discovery-0.2.jar;%axis_lib%\ commons-logging-1.0.4.jar;%axis_lib%\jaxrpc.jar;%axis_lib%\log4j-1.2.8.jar;%axis_lib%\saaj.jar;%axis_lib%\ Wsdl4j-1.5.1.jar;
catalina_home= D:\java\apache-tomcat-6.0.44
class_path=.; %java_home%\lib;%java_home%\lib\tools.jar;%catalina_home%\lib\servlet-api.jar;%tomcat_home%/lib/soap.jar;% tomcat_home%/lib/mail.jar;%tomcat_home%/lib/activation.jar;%tomcat_home%/lib/xerces.jar;%axisclasspath%;
java_home= D:\java\jdk1.5.0_17
path is inserted in front of%java_home%\bin;
1,) will download the axis1.3 decompression, the inside of the WebApps under the folder axis, copied to tomcat6.0 WebApps folder.
2,) Start tomcat6.0, if you have not installed tomcat6.0, you need to enter the directory: D:\java\apache-tomcat-6.0.44\bin
Under CMD, enter the directory, enter Serivce.bat install for tomcat6.0 installation, after the installation is complete, find D:\java\apache-tomcat-6.0.44\bin\ Tomcat6w.exe Double-click, click the Start button in the popup screen, wait for Tomcat to run up;
3,) Visit URL: Http://localhost:8080/axis
If the interface appears as follows:
If the interface is displayed as such, the axis1.3 has been published successfully.
4,) Open the text creation class and write a Java class like this:
1 Package com.group.webservices;2 3 Public classWebServiceTest {4 /**5 * Interface6 * */7 Publicstring Validate (string name) {8String message="";9message+="<?xml version=\ "1.0\" encoding=\ "utf-8\"?>";Tenmessage+="<root>"; One A if(name!=NULL&&name.trim (). Length () >0){ -message+="<resultCode>1056</resultCode>"; -message+="<resultMsg> parsing Success </resultMsg>"; the}Else{ -message+="<resultCode>1050</resultCode>"; -message+="<resultMsg> Illegal </resultMsg>"; - } + -message+="</root>"; + A returnmessage; at } -}
5,) Compile Webservicetest.java in cmd, enter Javac Webservicetest.java carriage return, compile a webservicetest.class file in the Webservicetest.java directory.
6) Copy the file Webservicetest.class to the directory D:\java\apache-tomcat-6.0.44\webapps\axis\WEB-INF\classes\com\group\ WebServices directory (Note: D:\java\apache-tomcat-6.0.44\webapps\axis\WEB-INF\classes\ 's directory is Webservicetest.java's namespace address)
7,) Create a new file under D:\java\apache-tomcat-6.0.44\webapps\axis\WEB-INF\ DEPLOY.WSDD
File contents:
<Deploymentname= "Test"xmlns= "http://xml.apache.org/axis/wsdd/"Xmlns:java= "Http://xml.apache.org/axis/wsdd/providers/java"><Servicename= "Testservice"provider= "Java:rpc"><parametername= "ClassName"value= "Com.group.webservices.WebServiceTest" /><parametername= "Allowedmethods"value= "Validate" /></Service></Deployment>
8,) Release the WebService command in CMD:
JAVA-CP%axisclasspath% org.apache.axis.client.AdminClient DEPLOY.WSDD
You will find that there is a SERVER-CONFIG.WSDD file in the directory, which is the configuration file of axis, which will be found in all future Service release descriptions. (Of course, you can modify it directly, do not write DEPLOY.WSDD) and then open the browser Http://localhost:8080/axis/servlet/AxisServlet, you will see your service has been published
9,) Click Publish Service, you can see the URL changes are:
http://localhost:8080/axis/services/TestService?wsdl
The content is displayed as:
1 <wsdl:definitionsXmlns:apachesoap= "Http://xml.apache.org/xml-soap"Xmlns:impl= "Http://localhost:8080/axis/services/TestService"xmlns:intf= "Http://localhost:8080/axis/services/TestService"Xmlns:soapenc= "http://schemas.xmlsoap.org/soap/encoding/"xmlns:wsdl= "http://schemas.xmlsoap.org/wsdl/"Xmlns:wsdlsoap= "http://schemas.xmlsoap.org/wsdl/soap/"xmlns:xsd= "Http://www.w3.org/2001/XMLSchema"targetnamespace= "Http://localhost:8080/axis/services/TestService">2 <!--3 WSDL created by Apache Axis version:1.34 Built on OCT 2005 (05:23:37 EDT)5 -6 <Wsdl:messagename= "ValidateRequest">7 <Wsdl:partname= "In0"type= "Soapenc:string"/>8 </Wsdl:message>9 <Wsdl:messagename= "Validateresponse">Ten <Wsdl:partname= "Validatereturn"type= "Soapenc:string"/> One </Wsdl:message> A <Wsdl:porttypename= "WebServiceTest"> - <wsdl:operationname= "Validate"Parameterorder= "In0"> - <Wsdl:inputmessage= "Impl:validaterequest"name= "ValidateRequest"/> the <Wsdl:outputmessage= "Impl:validateresponse"name= "Validateresponse"/> - </wsdl:operation> - </Wsdl:porttype> - <wsdl:bindingname= "Testservicesoapbinding"type= "Impl:webservicetest"> + <wsdlsoap:bindingstyle= "RPC"Transport= "Http://schemas.xmlsoap.org/soap/http"/> - <wsdl:operationname= "Validate"> + <wsdlsoap:operationSOAPAction=""/> A <Wsdl:inputname= "ValidateRequest"> at <Wsdlsoap:bodyEncodingstyle= "http://schemas.xmlsoap.org/soap/encoding/"namespace= "Http://webservices.group.com" Use= "encoded"/> - </Wsdl:input> - <Wsdl:outputname= "Validateresponse"> - <Wsdlsoap:bodyEncodingstyle= "http://schemas.xmlsoap.org/soap/encoding/"namespace= "Http://localhost:8080/axis/services/TestService" Use= "encoded"/> - </Wsdl:output> - </wsdl:operation> in </wsdl:binding> - <Wsdl:servicename= "Webservicetestservice"> to <Wsdl:portbinding= "Impl:testservicesoapbinding"name= "Testservice"> + <wsdlsoap:address Location= "Http://localhost:8080/axis/services/TestService"/> - </Wsdl:port> the </Wsdl:service> * </wsdl:definitions>
10,) Call the service using C #:
Copy the files to the new C # project:
This is the end of the book, Thank you.
Reference article:
http://blog.csdn.net/zhangzhaokun/article/details/4582977
Http://blog.163.com/[email protected]/blog/static/398052402010614114245570/
http://wenku.baidu.com/link?url=ZS_A2cHKQthibUg5vdu1jqu5Mhh0__ Hgmb9-ohhtpqj48kiwngsrr7xvhpjqgiyq94hkkw1aboxatabjxichzzabjvrfkhfcavorai1nehc
http://blog.csdn.net/hubin1989/article/details/40825407
Http://www.cnblogs.com/draem0507/archive/2012/09/13/2682720.html
Http://blog.sina.com.cn/s/blog_752ca76a01018275.html
tomcat6.0+jdk1.5+axis1.3 builds the Java WebService environment and invokes the service using C #.