⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 owaccounting.java

📁 陕西电信sp客户端
💻 JAVA
字号:
// ----------------------------------------------------------------------------
// $Source: /cvs/vas2006/webpro2/webpro_java/src/com/onewaveinc/portalman/webpro/OWAccounting.java,v $
// ----------------------------------------------------------------------------
// Copyright (c) 2002 by Onewave Inc.
// ----------------------------------------------------------------------------
// $Id: OWAccounting.java,v 1.1.1.1 2006/08/01 05:49:33 zhengx Exp $
// ----------------------------------------------------------------------------
// $Log: OWAccounting.java,v $
// Revision 1.1.1.1  2006/08/01 05:49:33  zhengx
// no message
//
// Revision 1.1  2006/06/02 03:33:15  wuyan
// *** empty log message ***
//
// Revision 1.1  2005/12/08 10:36:27  like
// no message
//
// Revision 1.1  2003/07/28 06:29:59  zengc
// no message
//
//
// ----------------------------------------------------------------------------

package com.onewaveinc.portalman.webpro;

/**
 * <p>Title: PortalMAN SDK API Documentation</p>
 * <p>Description: OneWave Technologies., Inc. PortalMAN Value-add Management Platform 3rd Software Development Kit</p>
 * <p>Copyright: Copyright (c) 2002 </p>
 * <p>Company: OneWave Technologies., Inc.</p>
 * @author 3rd AAA & ICP Integration Developement Team
 * @version 1.5
 */

import com.onewaveinc.portalman.webpro.soap.*;
import com.onewaveinc.portalman.aaa.v20.soapentity.*;
import com.onewaveinc.portalman.webpro.security.SecurityMgr;
import java.util.*;

/**
 * 该类是计费信息和消费确认信息记录接口<BR>
 * ICP通过调用此类的接口向计费中心发送用户计费信息和消费确认信息
 */

public class OWAccounting {
	private Vector paras;


	/**
	 * 类构建器
	 * @param conf SOAP调用参数
	 * @return
	 */

	OWAccounting(Vector conf){
		this.paras = conf;
	}
//

	/**
	 * 设置消费计费信息
	 * @param info 消费计费信息包  @see com.onewaveinc.portalman.webpro.entity.OWAccountingRequest
	 * @return 设置返回结果 @see com.onewaveinc.portalman.webpro.entity.OWAccoutingResult
	 * @throws Exception
	 */
	public com.onewaveinc.portalman.webpro.entity.OWAccountingResult setAccountingInfo(com.onewaveinc.portalman.webpro.entity.OWAccountingRequest info) throws Exception{

		SOAPConfig config = new SOAPConfig(paras);

		com.onewaveinc.portalman.webpro.entity.OWAccountingResult returnobj = null;
		boolean loopFlag = config.getNextConfig();
		while(loopFlag){

			try {


				WebProManager.debug("Invoke OWAccounting.setAccountingInfo(OWAccountingRequest info) ......");
				WebProManager.debug("Parameter entity object: \n" + info);
				String icpCode =WebProManager.mICPCode;
				String icpKey =WebProManager.mICPKey;


				OWAccountingRequest soap =	(OWAccountingRequest)
						   SOAPConveror.getEncodeEntity(info,"com.onewaveinc.portalman.aaa.v20.soapentity.OWAccountingRequest");
				soap.setIcpCode(icpCode);
				soap.setVersionNO(WebProManager.mVersion);
				soap.setIcpMode(WebProManager.mICPMode);
				WebProManager.debug("SOAP object to be send befor encypte: \n" + soap);
				WebProManager.log("SOAP object to be send befor encypte: \n" + soap);
				//encrypte
				SecurityMgr.getEncyptedObjUseICPKey(soap,null,icpKey);
				WebProManager.debug("SOAP object to be send , after encypte: \n" + soap);
				String oldIcpCode = soap.getIcpCode();


				String soapRouterURL = config.getRouterURL();
				String soapTargetObjectURI = config.getUrn();
				WebProManager.debug("Connect to SOAP Server: RouterURL=" + soapRouterURL + " , TargetObjectURI=" + soapTargetObjectURI);

				Class[] interfaces = new Class[] {CollectIFV20.class};
				CollectIFV20 aaa = (CollectIFV20)(SOAPProxy.newInstance(soapRouterURL, soapTargetObjectURI, interfaces));

				String requeststr = SOAPEntityConvertor.Object2String(soap);
				String resultstr = null;
				OWAccountingResult result = null;

				resultstr = aaa.collectDR(requeststr);

				result = (OWAccountingResult) SOAPEntityConvertor.String2Object(resultstr,OWAccountingResult.class);
				WebProManager.debug("SOAP object get from server, befor decypte: \n" + result);
				//decrypte
				SecurityMgr.getDecyptedObjUseICPKey(result,icpKey,oldIcpCode);
				WebProManager.debug("SOAP object get from server, after decypte: \n" + result);
				WebProManager.log("SOAP object get from server, after decypte: \n" + result);

				returnobj =	(com.onewaveinc.portalman.webpro.entity.OWAccountingResult)
							 SOAPConveror.getDecodeEntity(result,"com.onewaveinc.portalman.webpro.entity.OWAccountingResult");

				WebProManager.debug("Enity object return: \n" + returnobj);
				loopFlag = false;

			}catch (Exception ex) {
				if(loopFlag = config.getNextConfig()){
					ex.printStackTrace();
					WebProManager.log("Find Exception in Invoke OWAccounting.setAccountingInfo()");
					ex.printStackTrace(WebProManager.getLog());
					WebProManager.getLog().flush();
					System.out.println("Find Exception in Invoke OWAccounting.setAccountingInfo(), try next server");
				}else{
					WebProManager.log("Find Exception in Invoke OWAccounting.setAccountingInfo()");
					ex.printStackTrace(WebProManager.getLog());
					WebProManager.getLog().flush();
					throw ex;
				}
			}
		}
		WebProManager.closelog();
		return returnobj;
	}


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -