200c0c24ba6b001b12848a9f58aa6e03
来自「《精通SOA:基于服务总线的Struts+EJB+Web Service整合应用」· 代码 · 共 70 行
TXT
70 行
package com.sample.model.service.imp;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;
import javax.xml.rpc.ServiceException;
import localhost.webModule.services.checkUserLoginService.CheckUserLoginMgr;
import localhost.webModule.services.checkUserLoginService.CheckUserLoginMgrServiceLocator;
import localhost.webModule.services.getUserListService.GetUserListMgr;
import localhost.webModule.services.getUserListService.GetUserListMgrServiceLocator;
import localhost.webModule.services.saveUserInfoService.SaveUserInfoMgr;
import localhost.webModule.services.saveUserInfoService.SaveUserInfoMgrServiceLocator;
import wsClient.UserAccountDTO;
import com.sample.model.service.ifc.UserAccountMgrIfc;
import java.net.MalformedURLException;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class UserAccountMgrImp implements UserAccountMgrIfc {
public boolean checkUserLogin(String loginName, String password) throws ServiceException, RemoteException {
CheckUserLoginMgrServiceLocator userAccountMgrLocator = new CheckUserLoginMgrServiceLocator();
CheckUserLoginMgr userAccountMgr = userAccountMgrLocator.getcheckUserLoginService();
return userAccountMgr.checkUserLogin(loginName,password);
}
public void saveUserInfo(UserAccountDTO userAccountDTO) throws ServiceException, RemoteException {
SaveUserInfoMgrServiceLocator userAccountMgrLocator = new SaveUserInfoMgrServiceLocator();
SaveUserInfoMgr userAccountMgr = userAccountMgrLocator.getsaveUserInfoService();
userAccountMgr.saveUserInfo(userAccountDTO);
}
public List getUserList() throws ServiceException, RemoteException {
ArrayList list = new ArrayList();
UserAccountDTO[] userAccountDTOs = userAccountMgr.getUserList();
String endpoint = "http://localhost:7001/getUserListInbound";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName( "getJavaBeanWs" );
UserAccountDTO[] userAccountDTOs = (UserAccountDTO[]) (UserAccountDTO[]) call.invoke();
for (int i=0; i<userAccountDTOs.length; i++) {
list.add(userAccountDTOs[i]);
}
return list;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?