Liny_@NotePad

沉迷ACG中

在Tomcat中部署Axis搭建SOAP环境

YOYO posted @ 2009年12月26日 21:09 in 【Java EE】 with tags tomcat Axis SOAP , 3063 阅读

几个下载地址:

搭建步骤:

  1. 将Axis的压缩包解压后webapps目录下的axis目录拷贝到Tomcat的webapps目录下,
  2. 将xerces-j解压后得到的jar包放入Tomcat/webapps/axis/WEB-INF/lib目录下,
  3. 如果要支持JWS(临时发布,由Axis自动编译部署,即下文中用到的),要将jdk的tools.jar也拷贝进该目录。
  4. 同时配置环境变量,CLASSPATH中加上该目录下的所有jar包。
  5. 将JavaMail和JAF解压后的jar包拷到JDK的lib目录下和tomcat的lib目录下。
  6. 启动Tomcat,此时应可以看到axis的目录并能正常访问。
  7. 下面编写一个WebService程式HelloWorld.jws,并将之放入axis的目录下(会被axis自动编译部署):
    1. public class HelloWorld {
    2.  
    3.         public String sayHelloWorld(String name) {
    4.                 return name + ", Hello World!";
    5.         }
    6.        
    7. }
  8. 编写测试程式,在eclipse中创建一个项目,导入axis的lib目录下的所有jar包,新建TestClient类,代码如下:
    1. import java.net.MalformedURLException;
    2. import java.net.URL;
    3. import java.rmi.RemoteException;
    4.  
    5. import javax.xml.rpc.ServiceException;
    6.  
    7. import org.apache.axis.client.Call;
    8. import org.apache.axis.client.Service;
    9.  
    10. public class TestClient {
    11.  
    12.         public void doTest(String name) throws ServiceException, MalformedURLException, RemoteException {
    13.                 String url = "http://localhost:8080/axis/HelloWorld.jws";
    14.                 Service service = new Service();
    15.                 Call call = (Call) service.createCall();
    16.                 call.setTargetEndpointAddress(new URL(url));
    17.                 call.setOperationName("sayHelloWorld");
    18.                 String result = (String) call.invoke(new Object[] {name} );
    19.                 System.out.println(result);
    20.         }
    21.        
    22.         public static void main(String[] args) {
    23.                 try {
    24.                         new TestClient().doTest("YOYO");
    25.                 } catch (MalformedURLException e) {
    26.                         e.printStackTrace();
    27.                 } catch (RemoteException e) {
    28.                         e.printStackTrace();
    29.                 } catch (ServiceException e) {
    30.                         e.printStackTrace();
    31.                 }
    32.         }
    33.        
    34. }
  9. 运行该程式,若能得到正确的运行结果("YOYO, Hello World!")即说明成功搭建了一个SOAP环境。
icici balance check 说:
2022年10月03日 16:25

ICICI Bank balance enquiry can also be made through a missed call. To use the missed call services, register for ICICI Bank missed call banking by send. ICICI Bank balance enquiry can also be made through a missed call. To use the missed call services, register for ICICI Bank missed call banking by send. icici balance check number CICI Bank Balance Enquiry Using Toll free number. Dial 9594612612 or 022-?30256767 from your mobile number. After 2-3 rings, the call will get disconnected.CICI Bank Balance Enquiry Using Toll free number. Dial 9594612612 or 022-?30256767 from your mobile number. After 2-3 rings, the call will get disconnected.ICICI Bank balance enquiry can also be made through a missed call. To use the missed call services, register for ICICI Bank missed call banking by send. CICI Bank Balance Enquiry Using Toll free number. Dial 9594612612 or 022-?30256767 from your mobile number. After 2-3 rings, the call will get disconnected.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter