Axis stubs Web Service Development

Source: Internet
Author: User

Reference: http://blog.csdn.net/kay5804/article/details/2382428

 

1. Add relevant jar to c: \ Tomcat 5.0 \ common \ Lib

2.

Set axis_home = c: \ Tomcat 5.0 \ webapps \ axis
Set axis_lib = c: \ Tomcat 5.0 \ webapps \ axis \ WEB-INF \ Lib
Set classpath = .; % axis_lib % \ axis. jar; % axis_lib % \ axis-ant.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; % axis_lib %/mail. jar; % axis_lib %/XML. jar; % axis_lib %/xmlsec-1.4.4.jar;

Java org. Apache. axis. Client. adminclient-lhttp: // localhost: 9090/axis/services/stubs deploy. WSDD

Java org. Apache. axis. WSDL. wsdl2java-P Client

Http: // localhost: 9090/axis/services/stubs? WSDL

 

3. server. Java

Package com. Web. test;

Public class server {
Public String getbeanstr (userbean bean ){
Return "you name:" + bean. getname () +
", You age:" + bean. getage ();
}
 
 
Public userbean getbeanstr (string name, int age ){
Userbean user = new userbean ();
User. setage (AGE );
User. setname (name );

Return user;
}

}

 

4. userbean. Java

Package com. Web. test;

Public class userbean {
Private string name = "";
Private int age;
Public int getage (){
Return age;
}
 
Public void setage (INT age ){
This. Age = age;
}
 
Public String getname (){
Return name;
}
 
Public void setname (string name ){
This. Name = Name;
}

Public String tostring (){
Return "hello" + name + "(" + age + "), welcome to WebService study .";
}


}

 

5. Rad Testing Result:

 

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.