webServices 执行流程,(我是菜鸟,我怕谁,仅代表个人理解,欢迎各位大神们指导,不和您的胃口,请默默离开!!)
二、上图仅仅代表个人理解,下面以代码方式解释一下。
(1) strtus.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<!-- 功能:维护工具 lotus 开发者:wg 15-09 -->
<package name="/msp/invQryOrg" extends="default" namespace="/msp/invQryOrg">
<action name="init" class="lotusOrgAction" method="init">
<result name="init">/msp/pages/org/msLotusQryList.jsp</result>
</action>
<action name="query" class="lotusOrgAction" method="query">
<result name="list">/msp/pages/org/msLotusQryList.jsp</result>
</action>
<action name="detail" class="lotusOrgAction" method="detail">
<result name="success">/msp/pages/org/slLotusOrgDetail.jsp</result>
</action>
<action name="edit" class="lotusOrgAction" method="edit">
<result name="success">/msp/pages/org/slLotusOrgEditList.jsp</result>
</action>
<action name="update" class="lotusOrgAction" method="update">
<result name="success">/msp/pages/org/slLotusOrgEditList.jsp</result>
</action>
<action name="delete" class="lotusOrgAction" method="delete">
<result name="success">query.hlt</result>
</action>
<action name="qryhistory" class="lotusOrgAction" method="qryhistory">
<result name="list">/msp/pages/org/lotusOrgHistoryDetail.jsp</result>
</action>
<action name="initsave" class="lotusOrgAction" method="initsave">
<result name="init">/msp/pages/org/slLotusInputList.jsp</result>
</action>
<action name="save" class="lotusOrgAction" method="save">
<result name="success">/msp/pages/org/slLotusInputList.jsp</result>
</action>
</package>
</struts>
(2)spring.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"
default-lazy-init="true">
<description>运维工具配置</description>
<!-- 功能 LotusManager 开发者:wg 时间:2015-8-26 -->
<bean id="lotusOrgManager" class="com.holytax.eipp.msp.qorg.service.LotusOrgManager" parent="manager">
</bean>
<!-- 功能 报表Manager 开发者:wg 时间:2015-8-26 -->
<bean id="lotusOrgManagerImpl" class="com.holytax.eipp.msp.qorg.service.LotusOrgManagerImpl" parent="manager">
</bean>
<!-- 功能:LotusAction 开发者:wg 时间:2015-8-26-->
<bean id="lotusOrgAction" class="com.holytax.eipp.msp.qorg.action.LotusOrgAction" scope="prototype">
<!-- <property name="invoiceForManager" ref="invoiceForManager"/> -->
<property name="wsCfg" ref="propWsCfg"/>
</bean>
</beans>
(3)springServer.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> <import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<bean id="aegisBean" class="org.apache.cxf.aegis.databinding.AegisDatabinding" /> <bean id="jaxws-and-aegis-service-factory" class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
<property name="dataBinding" ref="aegisBean" />
</bean>
<!--目的:对于lotus的webservice服务器端配置 wg 时间:2012-09-11 -->
<jaxws:server id="lotusOrgManager" serviceClass="com.holytax.eipp.msp.qorg.service.LotusOrgManager" address="/LotusOrgManager"><!--接口地址-->
<jaxws:serviceBean>
<ref bean="lotusOrgManagerImpl"/><!--接口方法的实现-->
</jaxws:serviceBean>
<jaxws:inInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
<bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" /> <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
<constructor-arg>
<map>
<entry key="action" value="UsernameToken" />
<entry key="passwordType" value="PasswordText" />
<entry key="user" value="cxfServer" />
<entry key="passwordCallbackRef">
<ref bean="serverPasswordCallback" />
</entry>
</map>
</constructor-arg>
</bean> </jaxws:inInterceptors>
<jaxws:outInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
</jaxws:outInterceptors>
<jaxws:inFaultInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
</jaxws:inFaultInterceptors>
<jaxws:outFaultInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
</jaxws:outFaultInterceptors>
</jaxws:server>
</beans>
(4)Action.java
package com.holytax.eipp.msp.qorg.action; import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map; import org.apache.commons.lang.StringUtils;
import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.handler.WSHandlerConstants; import com.holytax.base.action.BaseAction;
import com.holytax.base.service.Page;
import com.holytax.base.util.Constants;
import com.holytax.base.util.StringUtil;
import com.holytax.eipp.msp.qorg.entity.TAcOrgdataBackup;
import com.holytax.eipp.msp.qorg.entity.TLotusAcOrg;
import com.holytax.eipp.msp.qorg.model.LotusOrgModel;
import com.holytax.eipp.msp.qorg.service.LotusOrgManager;
import com.holytax.eipp.webservice.cfg.IWsCfg;
import com.holytax.eipp.webservice.model.WsModel;
import com.holytax.eipp.webservice.security.ClientPasswordCallback; public class LotusOrgAction extends BaseAction<TLotusAcOrg>{ /**
*
*/
private static final long serialVersionUID = -3501266082603574394L;
private LotusOrgModel orgModel = new LotusOrgModel();
private TLotusAcOrg entity=new TLotusAcOrg();
private LotusOrgManager lotusOrgManager;
//private Page<InvcoiceInforModel> page = new Page<InvcoiceInforModel>(Constants.PAGESIZE);
private IWsCfg wsCfg;
private Page<Map<String, Object>> page = new Page<Map<String, Object>>(
Constants.PAGESIZE);
private String[] _chk;//记录选中数组
private TAcOrgdataBackup lotusentity =new TAcOrgdataBackup();//莲花备份实体
private String loginUser;private Long parentid;
private Long orgid;
@Override
protected void prepareModel() throws Exception {
WsModel wsModel = wsCfg.getWsModel("holylotus");
LotusOrgManager lotusOrgManager = getholyVatManager(wsModel.getUrl());
if(entity.getOrgid()!=null){
entity=lotusOrgManager.findInvById(entity.getOrgid());
} }
/**
* 初始化方法
* @return
*/
public String init(){
return INIT;
}
/**
* 初始化方法
* @return
*/
public String initsave(){
orgModel.setCode("holylotus");
//String company = invModel.getCompany();
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
entity.setParentid(entity.getParentid());
return INIT;
}
/**
* 新增机构
* @return
*/
public String save(){
orgModel.setCode("holylotus");
//String company = invModel.getCompany();
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
try {
loginUser=(String) getSession().getAttribute(Constants.LOGIN_NAME);
entity.setCreateBy(loginUser);
entity.setCreateTime(new Date());
lotusOrgManager.save(entity);
addActionMessage("机构信息保存成功!!");
entity.setOrgname(null);
entity.setOrgcode(null);
entity.setTaxname(null);
entity.setTaxno(null);
entity.setLinkman(null);
entity.setPhone(null);
entity.setAddress(null);
entity.setEmail(null);
entity.setPostcode(null);
entity.setBank(null);
entity.setAccount(null);
entity.setTreelevel(null);
entity.setTreelayer(null);
entity.setRemark(null);
} catch (Exception e) {
addActionMessage("机构信息保存失败!!");
entity.setOrgname(null);
entity.setOrgcode(null);
entity.setTaxname(null);
entity.setTaxno(null);
entity.setLinkman(null);
entity.setPhone(null);
entity.setAddress(null);
entity.setEmail(null);
entity.setPostcode(null);
entity.setBank(null);
entity.setAccount(null);
entity.setTreelevel(null);
entity.setTreelayer(null);
entity.setRemark(null);
e.printStackTrace();
}
return SUCCESS;
}
/**
*lotus org数据查询
* @return
* @throws Exception
*/
@SuppressWarnings("rawtypes")
public String query ()throws Exception{
orgModel.setCode("holylotus");
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
page = (Page<Map<String, Object>>) lotusOrgManager.findVatPageList(page,
"REPORTSQL.findOrgMessage", entity,orgModel, null);
return LIST;
}
/**
*lotus org数据查询
* @return
* @throws Exception
*/
@SuppressWarnings("rawtypes")
public String qryhistory ()throws Exception{
orgModel.setCode("holylotus");
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
page = (Page<Map<String, Object>>) lotusOrgManager.findVatPageList(page,
"REPORTSQL.findOldOrgMessage", entity,null, null);
return LIST;
}
/**
* 机构明细方法
* @return
* @throws Exception
*/
public String detail ()throws Exception{
orgModel.setCode("holylotus");
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
page = (Page<Map<String, Object>>) lotusOrgManager.findVatPageList(page,
"REPORTSQL.findOneOrgMessage", entity,null, null);
return SUCCESS; }
/**
* 机构信息修改
* @return
* @throws Exception
*/
public String edit ()throws Exception{
orgModel.setCode("holylotus");
//String company = invModel.getCompany();
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
try {
entity=lotusOrgManager.findInvById(entity.getOrgid());
lotusentity.setOrgid(entity.getOrgid());
lotusentity.setOrgcode(entity.getOrgcode());
lotusentity.setOrgname(entity.getOrgname());
lotusentity.setTaxno(entity.getTaxno());
lotusentity.setTaxname(entity.getTaxname());
lotusentity.setParentid(entity.getParentid());
lotusentity.setOrgtype(entity.getOrgtype());
lotusentity.setLinkman(entity.getLinkman());
lotusentity.setPhone(entity.getPhone());
lotusentity.setAddress(entity.getAddress());
lotusentity.setEmail(entity.getEmail());
lotusentity.setPostcode(entity.getPostcode());
lotusentity.setBank(entity.getBank());
lotusentity.setAccount(entity.getAccount());
lotusentity.setExtracttype(entity.getExtracttype());
lotusentity.setExtractsoftzone(entity.getExtractsoftzone());
lotusentity.setScansoftzone(entity.getScansoftzone());
lotusentity.setIsbottom(entity.getIsbottom());
lotusentity.setOrglevel(entity.getTreelevel());
lotusentity.setOrglayer(entity.getTreelayer());
lotusentity.setCompany(entity.getCompany());
lotusentity.setRemark(entity.getRemark());
//lotusentity.setAutocommit(entity.GET);
lotusentity.setCreateTime(entity.getCreateTime());
lotusentity.setCreateBy(entity.getCreateBy());
lotusentity.setLastModifyTime(entity.getLastModifyTime());
lotusentity.setLastModifyBy(entity.getLastModifyBy());
lotusentity.setExtf4(entity.getExtf4());
lotusentity.setExtf5(entity.getExtf5());
lotusentity.setOperationtype("0");
lotusOrgManager.savelotus(lotusentity);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return SUCCESS;
}
public String update ()throws Exception{
orgModel.setCode("holylotus");
//String company = invModel.getCompany();
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
try {
//entity=lotusOrgManager.findInvById(entity.getOrgid());//通过主键找到
entity.setLastModifyTime(new Date());//更改修改人,为当前登录用户,修改时间当前系统时间
loginUser=(String) getSession().getAttribute(Constants.LOGIN_NAME);
entity.setLastModifyBy(loginUser);
lotusOrgManager.updateGds(entity);
TLotusAcOrg entity=null;
setIsSuc("true");
} catch (Exception e) {
setIsSuc("false");
e.printStackTrace();
}
return SUCCESS; }
/**
* @描述:删除勾选的机构
* @作者:wg
* @日期:2013-06-30
* @return
* @throws Exception
*/
public String delete() throws Exception{
orgModel.setCode("holylotus");
//String company = invModel.getCompany();
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
try {
//entity=lotusOrgManager.findInvById(entity.getOrgid());//通过主键找到
//loginUser=(String) getSession().getAttribute(Constants.LOGIN_NAME);
for(int i = 0;i< _chk.length;i++){
if(StringUtils.isNotBlank(_chk[i])){
entity = lotusOrgManager.findInvById(Long.parseLong(_chk[i]));
lotusentity.setOrgid(entity.getOrgid());
lotusentity.setOrgcode(entity.getOrgcode());
lotusentity.setOrgname(entity.getOrgname());
lotusentity.setTaxno(entity.getTaxno());
lotusentity.setTaxname(entity.getTaxname());
lotusentity.setParentid(entity.getParentid());
lotusentity.setOrgtype(entity.getOrgtype());
lotusentity.setLinkman(entity.getLinkman());
lotusentity.setPhone(entity.getPhone());
lotusentity.setAddress(entity.getAddress());
lotusentity.setEmail(entity.getEmail());
lotusentity.setPostcode(entity.getPostcode());
lotusentity.setBank(entity.getBank());
lotusentity.setAccount(entity.getAccount());
lotusentity.setExtracttype(entity.getExtracttype());
lotusentity.setExtractsoftzone(entity.getExtractsoftzone());
lotusentity.setScansoftzone(entity.getScansoftzone());
lotusentity.setIsbottom(entity.getIsbottom());
lotusentity.setOrglevel(entity.getTreelevel());
lotusentity.setOrglayer(entity.getTreelayer());
lotusentity.setCompany(entity.getCompany());
lotusentity.setRemark(entity.getRemark());
//lotusentity.setAutocommit(entity.GET);
lotusentity.setCreateTime(entity.getCreateTime());
lotusentity.setCreateBy(entity.getCreateBy());
lotusentity.setLastModifyTime(entity.getLastModifyTime());
lotusentity.setLastModifyBy(entity.getLastModifyBy());
lotusentity.setExtf4(entity.getExtf4());
lotusentity.setExtf5(entity.getExtf5());
lotusentity.setOperationtype("1");
lotusOrgManager.savelotus(lotusentity); }
}
List<TLotusAcOrg> agreelist =lotusOrgManager.delete(_chk, (String)getSession().getAttribute(Constants.LOGIN_NAME));
if(agreelist.size()>0){
StringBuilder sb = new StringBuilder();
addActionMessage(sb.toString());
}else{
addActionMessage("成功删除!");
}
} catch (Exception e) {
addActionMessage("删除失败!");
e.printStackTrace();
} return SUCCESS;
}
/**
* @描述: 动态的生成一期库的管理类
* @作者:byq
* @日期:2012-9-14
* @return:ILotusVatManager
*/
private LotusOrgManager getholyVatManager(String address) {
if (logger.isDebugEnabled()) {
logger.debug("create LotusOrgManager client webservice...");
}
JaxWsProxyFactoryBean bean = new JaxWsProxyFactoryBean();
Map<String, Object> outProps = new HashMap<String, Object>();
outProps.put(WSHandlerConstants.ACTION,
WSHandlerConstants.USERNAME_TOKEN);
outProps.put(WSHandlerConstants.USER, "cxfClient");
outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS,
ClientPasswordCallback.class.getName());
WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
bean.getOutInterceptors().add(wssOut);
bean.getOutInterceptors().add(new SAAJOutInterceptor()); bean.setServiceClass(LotusOrgManager.class);
bean.setAddress(address + "/services/LotusOrgManager");
LotusOrgManager service = (LotusOrgManager) bean.create();
return service;
}
public IWsCfg getWsCfg() {
return wsCfg;
}
public LotusOrgModel getOrgModel() {
return orgModel;
}
public void setOrgModel(LotusOrgModel orgModel) {
this.orgModel = orgModel;
}
public LotusOrgManager getLotusOrgManager() {
return lotusOrgManager;
}
public void setLotusOrgManager(LotusOrgManager lotusOrgManager) {
this.lotusOrgManager = lotusOrgManager;
}
public void setWsCfg(IWsCfg wsCfg) {
this.wsCfg = wsCfg;
}
public Page<Map<String, Object>> getPage() {
return page;
}
public void setPage(Page<Map<String, Object>> page) {
this.page = page;
}
public TLotusAcOrg getEntity() {
return entity;
}
public void setEntity(TLotusAcOrg entity) {
this.entity = entity;
}
@Override
public TLotusAcOrg getModel() {
// TODO Auto-generated method stub
return entity;
}
public String[] get_chk() {
return _chk;
}
public void set_chk(String[] _chk) {
this._chk = _chk;
}
public TAcOrgdataBackup getLotusentity() {
return lotusentity;
}
public void setLotusentity(TAcOrgdataBackup lotusentity) {
this.lotusentity = lotusentity;
}
public String getLoginUser() {
return loginUser;
}
public void setLoginUser(String loginUser) {
this.loginUser = loginUser;
}
public Long getParentid() {
return parentid;
}
public void setParentid(Long parentid) {
this.parentid = parentid;
}
public Long getOrgid() {
return orgid;
}
public void setOrgid(Long orgid) {
this.orgid = orgid;
}
}
(5)WsModel.jsva
package com.holytax.eipp.webservice.model; public class WsModel { private String code;
private String desc;
private String url;
private String tableName; public WsModel(){ } public WsModel(String code, String desc,
String url){
this.code = code;
this.desc = desc;
this.url = url;
} public WsModel(String code, String desc,
String url, String tableName){
this.code = code;
this.desc = desc;
this.url = url;
this.tableName = tableName;
} public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
} @Override
public String toString() {
return "SystemModel [code=" + code + ", desc=" + desc + ", url=" + url
+ ", tableName=" + tableName + "]";
} }
(6)service-->manager.java
package com.holytax.eipp.msp.qorg.service; import java.util.List;
import java.util.Map; import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import com.holytax.base.service.IPage;
import com.holytax.eipp.msp.qorg.entity.TAcOrgdataBackup;
import com.holytax.eipp.msp.qorg.entity.TAcVangorgBackup;
import com.holytax.eipp.msp.qorg.entity.TLotusAcOrg;
import com.holytax.eipp.msp.qorg.entity.TVanguanOrg;
import com.holytax.eipp.msp.qorg.model.LotusOrgModel;
import com.holytax.eipp.webservice.adapter.MapAdapter;
import com.holytax.eipp.webservice.adapter.PageMapAdapter;
@WebService
public interface LotusOrgManager{
/**
*莲花部分,分页查询
* @param mapPage
* @param sql
* @param entity
* @param orgModel
* @param mapParam
* @return
*/
@SuppressWarnings("unchecked")
@WebMethod
@XmlJavaTypeAdapter(PageMapAdapter.class)
public IPage<Map<String, Object>> findVatPageList(
@WebParam(name = "mapPage")
@XmlJavaTypeAdapter(PageMapAdapter.class)
final IPage<Map<String, Object>> mapPage,
@WebParam
final String sql,
@WebParam(name = "entity")
final TLotusAcOrg entity,
@WebParam(name = "invModel")
final LotusOrgModel orgModel,
@WebParam(name = "mapParam")
@XmlJavaTypeAdapter(MapAdapter.class) final Map mapParam); @WebMethod
public TLotusAcOrg findInvById(@WebParam(name = "id")final Long id); @WebMethod
public TAcOrgdataBackup findOrgById(@WebParam(name = "id")final Long id); /**
* 修改对象
* @param entity
* add by ZM 2010-11-23
* @return
*/
@WebMethod
public void updateGds(TLotusAcOrg entity);
/**
* 新增或是更新保存对象
* @param entity
* add by sjy 2010-11-15
*/
@WebMethod
public void save(TLotusAcOrg entity); @WebMethod
public void savelotus(TAcOrgdataBackup lotusentity); /**
* @描述: 删除选中商品
* @作者: wg
* @日期:2015-5-19
* @param ids 选中的id数组
*/
@WebMethod
public List<TLotusAcOrg> delete(String[] ids, String attribute);
}
(6)service-->managerImpl.java
public class LotusOrgManagerImpl extends BaseManager implements LotusOrgManager{
/**
* @描述: 一期库发票修改查询
* @作者:wg
* @日期:2012-9-11
* @return:void
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public IPage<Map<String, Object>> findVatPageList(
final IPage<Map<String, Object>> mapPage,
final String sql,
final TLotusAcOrg entity,
final LotusOrgModel orgModel,
final Map mapParam){
Map<String, Object> map = new HashMap<String, Object>();
if(orgModel != null){
map.putAll(ConvertUtils.pojoToMap(orgModel));
}
if(mapParam != null){
map.putAll(mapParam);
}
if(entity != null){
map.putAll(ConvertUtils.pojoToMap(entity));
}
Page<Map<String, Object>> queryResult = sqlDao.findPage((Page)mapPage, sql, map);
return queryResult;
} /**
* 根据id查询对象
*
*/
public TLotusAcOrg findInvById(Long id) {
return (TLotusAcOrg) dao.findById(TLotusAcOrg.class, id);
}
/**
* 根据id查询对象
*
*/
public TAcOrgdataBackup findOrgById(Long id) {
return (TAcOrgdataBackup) dao.findById(TAcOrgdataBackup.class, id);
}
/**
* 修改对象
* @param entity
* add by wg 2010-11-23
* @return
*/
public void updateGds(TLotusAcOrg entity){
dao.saveOrUpdate(entity);
}
/**
* 新增或是更新保存对象
* @param entity
* add by wg 2010-11-15
*/
public void save(TLotusAcOrg entity){
dao.save(entity);
} public void savelotus(TAcOrgdataBackup lotusentity){
dao.save(lotusentity);
}
/**
* 删除选中数据
*/
@Override
public List<TLotusAcOrg> delete(String[] ids, String attribute) {
List list = new ArrayList();
TLotusAcOrg ent = null;
for(int i = 0;i< ids.length;i++){
if(StringUtils.isNotBlank(ids[i])){
ent = this.findInvById(Long.parseLong(ids[i]));
}
//删除主表
dao.delete(ent);
}
return list;
}
}
(7)最后在总的配置文件配置sql.xml,spring.xml,strtus即可。。。。
(8)所谓的服务端,就是把客户端复制一份,,修改项目名。。。更改数据连接地址即可。。。还有一种情况,就是客户端,即是服务端,又是客户端,,但是流程是一样的。。。
webServices 执行流程,(我是菜鸟,我怕谁,仅代表个人理解,欢迎各位大神们指导,不和您的胃口,请默默离开!!)的更多相关文章
- HDU 2520 我是菜鸟我怕谁
2019-05-27 17:52:01 加油!!! 看题时候就要仔细,最后容易忘记%10000 #include <bits/stdc++.h> using namespace std; ...
- 深入浅出Mybatis系列(十)---SQL执行流程分析(源码篇)
最近太忙了,一直没时间继续更新博客,今天忙里偷闲继续我的Mybatis学习之旅.在前九篇中,介绍了mybatis的配置以及使用, 那么本篇将走进mybatis的源码,分析mybatis 的执行流程, ...
- JavaScript 引擎 V8 执行流程概述
本文首发于 vivo互联网技术 微信公众号 链接:https://mp.weixin.qq.com/s/t__Jqzg1rbTlsCHXKMwh6A作者:赖勇高 本文主要讲解的是V8的技术,是V8的入 ...
- 深入浅出Mybatis系列十-SQL执行流程分析(源码篇)
注:本文转载自南轲梦 注:博主 Chloneda:个人博客 | 博客园 | Github | Gitee | 知乎 最近太忙了,一直没时间继续更新博客,今天忙里偷闲继续我的Mybatis学习之旅.在前 ...
- 【推理引擎】从源码看ONNXRuntime的执行流程
目录 前言 准备工作 构造 InferenceSession 对象 & 初始化 让模型 Run 总结 前言 在上一篇博客中:[推理引擎]ONNXRuntime 的架构设计,主要从文档上对ONN ...
- HDU2520 我是菜鸟,我怕谁
http://acm.hdu.edu.cn/showproblem.php?pid=2520 我是菜鸟,我怕谁 Time Limit: 2000/1000 MS (Java/Others) Memor ...
- 我是菜鸟,我怕谁--hdu2520
我是菜鸟,我怕谁 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Su ...
- HDU 2520 我是菜鸟,我怕谁
我是菜鸟,我怕谁 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Su ...
- 我是菜鸟,我怕谁(hdu2520)
我是菜鸟,我怕谁 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total S ...
随机推荐
- 【HDOJ】2795 Billboard
线段树.注意h范围(小于等于n). #include <stdio.h> #include <string.h> #define MAXN 200005 #define lso ...
- 登录MD5加盐处理
一:解决方案资源管理器截图: 二:operatorDAL.cs代码 using System; using System.Collections.Generic; using System.Linq; ...
- python for selenium 数据驱动测试
# -*- coding:utf-8 -*- """ 数据驱动测试,从 csv 文件中读取数据 """ from selenium impo ...
- MIPI总结和MIPI规格说明书
1. MIPI 因为是差分信号,所以时钟和数据lane 都是一对一对的,对应的即是: 1land = lane(N) + lane(P). 分享mipi 规格说明书文档如下: http://yun.b ...
- lightoj1057 - Collecting Gold (tsp问题)
题目链接:http://lightoj.com/volume_showproblem.php?problem=1057 题目大意:在二维矩阵中,给你一个起点和至多15个的目标点.要你求出从起点出发经过 ...
- Android 解决ScrollView下嵌套ListView进页面不在顶部的问题
以下为整理: 方法1 刚开始还可以,后来再调试时就不行了. 为了解决scrollview和listview冲突 设置了listview的高度 结果进页面就不是在顶部了 . 解决方案1:Scrol ...
- maven常用插件配置
1.maven-jar-plugin插件 <!-- 排除资源文件中的properties文件,不需要打到jar中,后面通过assembly插件打包到conf目录中 --><plugi ...
- 超级好用的国际汇兑平台--Transferwise
一年的CSC留学快结束了,手里还剩了些积攒下来的美元.就国内那点博士的工资,出来一趟好不容易领了点美元可不想都给银行汇兑的手续费给吞了去. 这两天英国退欧,英镑大跌,美元有涨,是个把手里的美元寄回国换 ...
- rails tutorial sample app
阅读第3章时,按照教程第一次运行rspec失败了: E:\05 Create\Code\temp\railstutorial\sample_app>rspec spec/requests/sta ...
- Java 23种设计模式详尽分析与实例解析之一--创建型模式
面向对象的设计原则 常用的面向对象设计原则包括7个,这些原则并不是独立存在的,它们相互依赖.互为补充. Java设计模式 创建型模式 简单工厂模式 模式动机: 考虑一个简单的软件应用场景,一个软件系统 ...