论坛首页 Java版 SOA

手把手教你用axis创建自己的webservice(四)

浏览 7652 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
最后更新时间:2007-03-05 关键字: SOA service

除了最后两个发布文件以外最重要的有两个文件,即MobileBossSoapBindingImpl.javaMobileBossServiceLocator.java

MobileBossSoapBindingImpl代码如下:

java 代码

1.   java 代码

/**  

2.           * MobileBossSoapBindingImpl.java  

3.           *  

4.           * This file was auto-generated from WSDL  

5.           * by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter.  

6.           */  

7.            

8.          package com.yy.ws;   

9.            

10.       public class MobileBossSoapBindingImpl implements com.yy.ws.MobileBoss{   

11.           public com.yy.ws.ServerResponse charge(com.yy.ws.ClientRequest in0) throws java.rmi.RemoteException {   

12.               return null;   

13.           }   

14.         

15.       }   

我们需要在这个webservice中实现自己的业务方法!我们加入如下业务代码:

java 代码

1.          /**  

2.           * MobileBossSoapBindingImpl.java  

3.           *  

4.           * This file was auto-generated from WSDL  

5.           * by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter.  

6.           */  

7.            

8.          package com.yy.ws;   

9.            

10.       public class MobileBossSoapBindingImpl implements com.yy.ws.MobileBoss {   

11.         

12.           /*  

13.            *   

14.            * implements the service methods  

15.            */  

16.           public com.yy.ws.ServerResponse charge(com.yy.ws.ClientRequest req)   

17.                   throws java.rmi.RemoteException {   

18.               String bizInfo = req.getPhoneNumber() + "/" + req.getOpType() + "/"  

19.                       + req.getAmount();   

20.               System.out.println(bizInfo);   

21.               System.out.println(req.getPhoneNumber() + "is charged successfully!");   

22.               ServerResponse res = new ServerResponse();   

23.               res.setMessage(bizInfo);// save service informations.   

24.               res.setResultCode(8888);// save result code.   

25.               return res;   

26.           }   

27.         

28.       }   

 

   
最后更新时间:2007-05-10
MobileBossServiceLocator.java 这个类好象没贴出来啊
   
0 请登录后投票
论坛首页 Java版 SOA

跳转论坛:
JavaEye推荐