版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、Oracle Service Bus安裝配置手冊目 錄1Oracle Service Bus 安裝42Oracle Service Bus域配置113開發(fā)環(huán)境準(zhǔn)備163.1Server配置163.2建立Oracle Service Bus 配置項(xiàng)目及項(xiàng)目173.3建立記Log的Java項(xiàng)目203.4配置WebLogic Server的連接池(記Log要用)223.5配置Queue(對帳交易中用到)233.6建立對Socket Transport的支持293.7電子支付平臺與碼頭接口配置344接口說明414.1接口需求文檔414.2Oracle Service Bus接口描述415服務(wù)配置過程及
2、測試425.1工行實(shí)時(shí)扣費(fèi)及劃帳服務(wù)配置(ICBCServices)425.2工行對帳服務(wù)配置(BatchServices)615.3電子支付平臺到碼頭服務(wù)配置(SCTService)646使用和對接711 Oracle Service Bus 安裝點(diǎn)擊osb103_weblogic103_win32.exe建立BEA Home選擇Custom方式,并選擇所有選擇安裝JDK2 Oracle Service Bus域配置啟動配置向?qū)onfiguration wizard(program->Oracle WebLogic->WebLogic Server 10gr3->Tool
3、s->Configuration Wizard)選擇Create a new WebLogic domain,然后Next選擇Workshop for WebLogic10.3和Oracle Service Bus,然后Next輸入WebLogic管理控制臺用戶名密碼(weblogic/weblogic),然后Next選擇域的運(yùn)行模式,缺省開發(fā)模式,然后選擇相應(yīng)的JDK,然后Next選擇Next輸入域名稱和所在目錄,選擇Create,直到完成,選擇DoneOracle Service Bus的域配置完成.3 開發(fā)環(huán)境準(zhǔn)備3.1 Server配置打開workshop(Program -&g
4、t; Oracle WebLogic -> Workshop for WebLogic 10gr3),在Servers的視圖中選擇新建選擇Oracle WebLogic Server v10.3,然后Next配置域路徑直到出現(xiàn)配置server過程完成3.2 建立Oracle Service Bus 配置項(xiàng)目及項(xiàng)目選擇File->New->Oracle Service Bus Configuration Project輸入項(xiàng)目名,比如EPSProject1選擇EPSProject1,右鍵建立Oracle Service Bus項(xiàng)目輸入項(xiàng)目名稱,然后Finish在新建立的Orac
5、le Service Bus項(xiàng)目下如圖建立以下目錄(Folder),分別是BusinessServices,ProxyServices,ServiceAccount,Tranformation,WSDL,Jar分別作為以下用途BusinesssServices:用于存放定義的Business Services,接入后端服務(wù)ProxyServices:用于定義Proxy Services,提供前端調(diào)用接口ServiceAccount:用于定義ftp的訪問需要的用戶名密碼Transformation:用于存放和定義在過程中發(fā)生的數(shù)據(jù)轉(zhuǎn)換WSDL:用于存放WSDL文件Jar:用于Java Callo
6、ut,主要是通過Java Callout方式來記日志3.3 建立記Log的Java項(xiàng)目n 首先先在數(shù)據(jù)庫表中建立osblog表Create table osblog(Transno varchar(20),Message varchar(200),Transdate date);n 在WebLogic console中建立到數(shù)據(jù)庫的連接池,JNDI設(shè)置為XEn 建立Java Project,注意在build路徑下加入weblogic.jarn 先建立一個(gè)osbutility的package,然后新建OsbLogMessage類,代碼如下:package osbutility;import ja
7、va.sql.Connection;import java.sql.SQLException;import java.sql.Statement;import java.util.*;import javax.naming.Context;import javax.naming.InitialContext;public class OsbLogMessage /* * param args */*public static void main(String args) / TODO Auto-generated method stub*/public static boolean log(S
8、tring transno,String mess) Connection con = null; Statement stmt = null; int val = 1;try Context ctx = null; Hashtable<String,String> ht = new Hashtable<String,String>(); ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory"); ht.put(Context.PROVIDER_UR
9、L,"t3:/localhost:7001"); ht.put(Context.SECURITY_PRINCIPAL, "weblogic"); ht.put(Context.SECURITY_CREDENTIALS, "weblogic"); ctx = new InitialContext(ht); javax.sql.DataSource ds= (javax.sql.DataSource) ctx.lookup("XE"); con = ds.getConnection(); String sql = &q
10、uot;insert into osblog values('"+transno+"','"+mess+"',sysdate)" System.out.println(sql); stmt = con.createStatement(); val = stmt.executeUpdate(sql); catch (Exception e) System.out.println(e.getMessage(); finally try if (stmt != null) stmt.close(); if (con !
11、= null) con.close(); catch (SQLException e) System.out.println(e.toString(); if (val != 0) return false; return true;3.4 配置WebLogic Server的連接池(記Log要用)打開WebLogic Server管理控制臺http:/localhost:7001/console新建Services->JDBC->DataSource其他選擇缺省設(shè)置,并且設(shè)置用戶名密碼,測試通過部署到AdminServer就可3.5 配置Queue(對帳交易中用到)1) 選擇Se
12、rvices->Messaging->JMS Modules,建立CHModule選擇部署到AdminServer2) 新建JMS Servers同時(shí)部署到AdminServer3) 在CHModule中建立ConnectionFactory4) 然后新建Queue5) 選擇新建Subdeployment如圖完成3.6 建立對Socket Transport的支持1) 先在cmd下轉(zhuǎn)到需要部署的Oracle Service Bus domain目錄(如E:beauser_projectsdomainsCH_domainbin),運(yùn)行SetDomainEnv.cmd2) 在cmd下轉(zhuǎn)
13、到相應(yīng)的Socket Transport的安裝目錄(如E:beaosb_10.3samplesservicebussample-transport),修改在E:beaosb_10.3samplesservicebussample-transportsrccombeaalsbtransportssock中的SocketTransportUIBinding.java,主要修改方法為: (藍(lán)色)public boolean isServiceTypeSupported(BindingTypeInfo bindingType) return true; /* try BindingTypeInfo.B
14、indingTypeEnum type = bindingType.getType(); if (type.equals(BindingTypeInfo.BindingTypeEnum.MIXED) BindingTypeInfo.MessageTypeEnum responseMessageType = bindingType.getResponseMessageType(); if (responseMessageType != null) if (!( BindingTypeInfo.MessageTypeEnum.TEXT.equals(responseMessageType) | .
15、equals(responseMessageType) return false; BindingTypeInfo.MessageTypeEnum requestMessageType = bindingType.getRequestMessageType(); if (requestMessageType != null) return BindingTypeInfo.MessageTypeEnum.TEXT.equals(requestMessageType) | BindingTypeInfo.MessageTypeEnum.XML.equals(requestMessageType);
16、 else return false; return type.equals(BindingTypeInfo.BindingTypeEnum.ABSTRACT_XML) | type.equals(BindingTypeInfo.BindingTypeEnum.XML); catch (TransportException e) SocketTransportUtil.logger.error(e.getLocalizedMessage(), e); return false; */ 3) 修改SocketOutBoundMessageContext.javaRun方法主要決定如何處理從后端系
17、統(tǒng)的返回,修改的部分如藍(lán)色public void run() try / if the end-point is one-way, don't read the response. if (!epc.getRequestResponse() SocketTransportMessagesLogger.oneWayEndpoint(); listener.onReceiveResponse(SocketOutboundMessageContext.this); return; String resEnc = getResponseEncoding(); responseMetadata
18、= new SocketResponseMetaData(resEnc); InetAddress inetAddress = clientSocket.getInetAddress(); responseMetadata.setEndPointHost(inetAddress.getHostName(); responseMetadata.setEndPointIP(inetAddress.getHostAddress(); / Reading the response from the external service. InputStream inputStream = clientSo
19、cket.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader(inputStream, resEnc); int i = -1; StringBuilder sb = new StringBuilder(); char buff = new char512; while (true) i = inputStreamReader.read(buff); if (i = -1) break; sb.append(buff, 0, i); /* if it ends with double CRL
20、F, come out. We can read the content * after rnrn becuase we are expecting only one message per * connection i.e we are closing the connection after processing a * single message. */ if (i = sb.indexOf(SocketTransportUtil.FIN_FLAG) != -1) break; if (i != -1) / strip rnrn from the message. String msg
21、 = sb.substring(0, i+2); responseIS = new ByteArrayInputStream(msg.getBytes(resEnc); listener.onReceiveResponse(SocketOutboundMessageContext.this); else / Message format is wrong, it should end with rnrn listener.onError(SocketOutboundMessageContext.this, TransportManager.TRANSPORT_ERROR_GENERIC, So
22、cketTransportMessagesLogger.invalidMessage(); catch (IOException e) SocketTransportUtil.logger.error(e.getLocalizedMessage(), e); listener.onError(SocketOutboundMessageContext.this, TransportManager.TRANSPORT_ERROR_GENERIC, e.getLocalizedMessage(); catch (TransportException trex) SocketTransportUtil
23、.logger.error(trex.getLocalizedMessage(), trex); listener.onError(SocketOutboundMessageContext.this, TransportManager.TRANSPORT_ERROR_GENERIC, trex.getLocalizedMessage(); finally try clientSocket.close(); catch (IOException e) SocketTransportUtil.logger.error(e.getLocalizedMessage(), e); 4) Send則決定如
24、何把信息從OSB發(fā)給后端系統(tǒng),改動部分如藍(lán)色:public void send(final TransportSendListener listener) throws TransportException String address = options.getURI().toString(); try String host = null; int port = 0; try URI uri = new URI(address); host = uri.getHost(); port = uri.getPort(); catch (URISyntaxException e) new Tra
25、nsportException(e.getMessage(), e); SocketTransportMessagesLogger.ipAddress(host, port); final Socket clientSocket = new Socket(host, port); SocketEndpointConfiguration socketEndpointConfiguration = SocketTransportUtil.getConfig(config); SocketOutboundPropertiesType outboundProperties = socketEndpoi
26、ntConfiguration.getOutboundProperties(); clientSocket.setTcpNoDelay(!outboundProperties.getEnableNagleAlgorithm(); clientSocket.setSoTimeout(outboundProperties.getTimeout(); String reqEnc = socketEndpointConfiguration.getRequestEncoding(); if (reqEnc = null) reqEnc = "utf-8" / Send the mes
27、sage to the external service. OutputStream outputStream = clientSocket.getOutputStream(); TransformOptions transformOptions = new TransformOptions(); transformOptions.setCharacterEncoding(reqEnc); sender.getPayload().writeTo(outputStream, transformOptions); /outputStream.write(SocketTransportUtil.D_
28、CRLF.getBytes(reqEnc); outputStream.flush(); SocketTransportMessagesLogger.flushed(); PipelineAcknowledgementTask task = new PipelineAcknowledgementTask(listener, clientSocket, socketEndpointConfiguration); TransportManagerHelper .schedule(task, socketEndpointConfiguration.getDispatchPolicy(); catch
29、 (UnknownHostException e) SocketTransportUtil.logger.error(e.getLocalizedMessage(); throw new TransportException(e.getMessage(), e); catch (IOException e) SocketTransportUtil.logger.error(e.getLocalizedMessage(); throw new TransportException(e.getMessage(), e); catch (TransformException e) SocketTra
30、nsportUtil.logger.error(e.getLocalizedMessage(); throw new TransportException(e.getMessage(), e); catch (TransportException e) SocketTransportUtil.logger.error(e.getLocalizedMessage(); throw e; 5) 轉(zhuǎn)到相應(yīng)的Socket Transport的安裝目錄(如E:beaosb_10.3samplesservicebussample-transport),運(yùn)行ant clean6) 運(yùn)行ant build-j
31、ar7) 運(yùn)行ant deploy3.7 電子支付平臺與碼頭接口配置i. 在Weblogic Workshop中創(chuàng)建一個(gè)支持XMLBean的Web Service Projectii. 在項(xiàng)目底下的“Schema”文件夾中新建一個(gè)Schema:iii. 編輯該Schema文件,將接口中需要用到的數(shù)據(jù)結(jié)構(gòu)定義在該Schema文件中: <?xml version="1.0" encoding="UTF-8" ?> <schema xmlns="" targetNamespace="" xm
32、lns:tns="" elementFormDefault="qualified"><complexType name="PaySuccessInfoList"><sequence> <element name="PaySuccessInfoElm" type="tns:PaySuccessInfoType" minOccurs="0" maxOccurs="unbounded" /> &
33、lt;/sequence> </complexType><complexType name="PaySuccessInfoType"> <sequence> <element name="CUSTOMS_SHIP_NO" type="string" /> <element name="VOY_NO" type="string" /> <element name="
34、BILL_NO" type="string" /> <element name="TOTAL_MONEY" type="string" /> <element name="T_NUM" type="string" /> <element name="F_NUM" type="string" /> <element name="PAY_
35、DATE" type="string" /> <element name="FEE_TYPE" type="string" /> <element name="PAY_TYPE" type="string" /> <element name="IO_TYPE" type="string" /> <element name="RELEA
36、SE_STATUS" type="string" /> <element name="PAYER" type="string" /> <element name="PAY_DATETIME" type="string" /> <element name="BROKER" type="string" /> <element name="
37、CNTR_NO_LIST" type="tns:CNTR_NO_LISTTYPE" /> </sequence> </complexType><complexType name="CNTR_NO_LISTTYPE"><sequence> <element name="CNTR_NO" type="string" minOccurs="0" maxOccurs="unbounded
38、" /> </sequence> </complexType> <element name="PaySuccessInfo" type="tns:PaySuccessInfoList" /> <complexType name="DayTotalMoneyType"><sequence> <element name="dayTotalMoney" type="long&quo
39、t; /> </sequence> </complexType> <element name="DayTotalMoney" type="tns:DayTotalMoneyType" /> <complexType name="BillPayStatusInputList"> <sequence> <element name="BillPayStatusElm" type="tns:B
40、illPayStatusInputType" minOccurs="0" maxOccurs="unbounded" /> </sequence> </complexType> <complexType name="BillPayStatusInputType"> <sequence> <element name="CUSTOMS_SHIP_NO" type="string" />
41、 <element name="VOY_NO" type="string" /> <element name="BILL_NO" type="string" /> <element name="CNTR_NO_LIST" type="tns:CNTR_NO_LISTTYPE" /> </sequence> </complexType> &l
42、t;element name="BillPayStatusInput" type="tns:BillPayStatusInputList" /> <complexType name="BillPayStatusReturnType"><sequence> <element name="BILL_NO" type="string" /> <element name="BillPayStatus" type
43、="string" /> </sequence> </complexType> <element name="BillPayStatusReturn" type="tns:BillPayStatusReturnType" /> <complexType name="TurntoTerminalList"> <sequence> <element name="TurntoTerminal
44、Elm" type="tns:TurntoTerminalType" maxOccurs="unbounded" /> </sequence> </complexType> <complexType name="TurntoTerminalType"> <sequence> <element name="bankid" type="string" /> <elem
45、ent name="totalmoney" type="long" /> </sequence> </complexType> <element name="TurntoTerminalList" type="tns:TurntoTerminalList" /> </schema>iv. 在“src”文件夾下創(chuàng)建包及Web Service:v. 在”InterfaceSCT.java”文件中實(shí)現(xiàn)與碼頭的接口:p
46、ackage ;import javax.jws.*;import org.example.serviceIntegrateSchema.*;WebServicepublic class InterfaceSCT /接口A paySuccessInfoWebMethodpublic void paySuccessInfo(String bankId,String feebillNo,PaySuccessInfoDocument bill_list) PaySuccessInfoList psil = bill_list.getPaySuccessInfo();int len = psil.ge
47、tPaySuccessInfoElmList().size();for(int i = 0;i<len;i+)PaySuccessInfoType ps = psil.getPaySuccessInfoElmList().get(i);System.out.println("this is broker"+i+":"+ps.getBROKER();System.out.println("this is length of containernos: "+ps.getCNTRNOLIST().sizeOfCNTRNOArray()
48、;/接口B dayAccountWebMethodpublic DayTotalMoneyDocument dayAccount(long startdate,long enddate) DayTotalMoneyDocument dtm = DayTotalMoneyDocument.Factory.newInstance();DayTotalMoneyType dtmt = dtm.addNewDayTotalMoney();dtmt.setDayTotalMoney(1000000);return dtm;/接口C BillPayStatusWebMethodpublic BillPay
49、StatusReturnDocument getBillPayStatus(BillPayStatusInputDocument bill_list,String iotype) BillPayStatusReturnDocument bpsr = BillPayStatusReturnDocument.Factory.newInstance();BillPayStatusInputList bp = bill_list.getBillPayStatusInput();int len = bp.getBillPayStatusElmList().size();for(int i = 0;i&l
50、t;len;i+)BillPayStatusInputType bps = bp.getBillPayStatusElmList().get(i);System.out.println(bps.getBILLNO();return bpsr;/接口D turntoTerminalWebMethodpublic void turntoTerminal(TurntoTerminalListDocument turnto_list) TurntoTerminalList ttl = turnto_list.getTurntoTerminalList();int len = ttl.getTurnto
51、TerminalElmList().size();for(int i = 0;i<len;i+)TurntoTerminalType ttt = ttl.getTurntoTerminalElmList().get(i);System.out.println(ttt.getBankid()+": "+ttt.getTotalmoney();return;vi. 生成WSDL文件:4 接口說明4.1 接口需求文檔參見<<電子渠道接口說明.doc>>4.2 Oracle Service Bus接口描述工行接口ICBCServicesn doTran
52、s2CH工行扣費(fèi)操作 (wsdl參見機(jī)器上的E:CH_OSBWorkspaceWSDL ICBCServicesService.wsdl)n doTrans2Har工行劃賬操作 (wsdl參見機(jī)器上的E:CH_OSBWorkspaceWSDL ICBCServicesService.wsdl)碼頭接口InterfaceSCTService n turntoTerminal分帳信息接口n getBillPayStatus核對是否收費(fèi)n dayAccount對帳n paySuccessInfo收費(fèi)成功5 服務(wù)配置過程及測試5.1 工行實(shí)時(shí)扣費(fèi)及劃帳服務(wù)配置(ICBCServices)1 添加Bus
53、iness Services ICBCBusinessServices,用于和ICBC提供的Socket Server進(jìn)行信息交換配置如下:2 在WSDL目錄中新建ICBCServiceService.wsdl,將前端的需要的wsdl格式倒入<?xml version='1.0' encoding='UTF-8'?><s0:definitions name="ICBCServicesServiceDefinitions" targetNamespace="http:/bank" xmlns="&
54、quot; xmlns:s0="/wsdl/" xmlns:s1="http:/bank" xmlns:s2="/wsdl/soap/"> <s0:types> <schema elementFormDefault="qualified" targetNamespace="/onlineTrans2CH" xmlns="h
55、ttp://2001/XMLSchema" xmlns:tns="/onlineTrans2CH"> <element name="transferobject"> <complexType> <sequence> <element name="Transcode" type="string"/> <element name="Transno" type="
56、;string"/> <element name="PaymentCardno" type="string"/> <element name="Accountname" type="string"/> <element name="Paymentmoney" type="string"/> <element name="Type" type="string"/> <e
57、lement name="Memo" type="string"/> </sequence> </complexType> </element> <element name="transferresult"> <complexType> <sequence> <element name="Transstatus" type="string"/> <element name="Transres
58、ult" type="string"/> <element name="Message" type="string"/> <element name="Memo1" type="string"/> <element name="Memo2" type="string"/> </sequence> </complexType> </element> </schema> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http:/bank&
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 幀定位在增強(qiáng)現(xiàn)實(shí)中的應(yīng)用-深度研究
- 交互設(shè)計(jì)創(chuàng)新-深度研究
- 光譜與生物傳感技術(shù)-深度研究
- 基于微服務(wù)的View模塊化-深度研究
- 家電行業(yè)人工智能技術(shù)應(yīng)用-深度研究
- 云服務(wù)等級協(xié)議設(shè)計(jì)-深度研究
- 發(fā)酵調(diào)味品微生物多樣性-深度研究
- 2025年廣東科貿(mào)職業(yè)學(xué)院高職單招職業(yè)適應(yīng)性測試近5年??及鎱⒖碱}庫含答案解析
- 2025年廣東文理職業(yè)學(xué)院高職單招高職單招英語2016-2024歷年頻考點(diǎn)試題含答案解析
- 2025年巴中職業(yè)技術(shù)學(xué)院高職單招職業(yè)技能測試近5年??及鎱⒖碱}庫含答案解析
- 完整版秸稈炭化成型綜合利用項(xiàng)目可行性研究報(bào)告
- 油氣行業(yè)人才需求預(yù)測-洞察分析
- 《數(shù)據(jù)采集技術(shù)》課件-Scrapy 框架的基本操作
- 2025年河北省單招語文模擬測試二(原卷版)
- 高一化學(xué)《活潑的金屬單質(zhì)-鈉》分層練習(xí)含答案解析
- DB34∕T 4010-2021 水利工程外觀質(zhì)量評定規(guī)程
- 2024老年人靜脈血栓栓塞癥防治中國專家共識(完整版)
- 四年級上冊脫式計(jì)算100題及答案
- 上海市12校2023-2024學(xué)年高考生物一模試卷含解析
- 儲能電站火災(zāi)應(yīng)急預(yù)案演練
- 人教版(新插圖)二年級下冊數(shù)學(xué) 第4課時(shí)用“進(jìn)一法”和“去尾法”解決簡單的實(shí)際問題 教學(xué)課件
評論
0/150
提交評論