




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Oracle Service Bus安裝配置手冊(cè)目 錄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(對(duì)帳交易中用到)233.6建立對(duì)Socket Transport的支持293.7電子支付平臺(tái)與碼頭接口配置344接口說(shuō)明414.1接口需求文檔414.2Oracle Service Bus接口描述415服務(wù)配置過程及
2、測(cè)試425.1工行實(shí)時(shí)扣費(fèi)及劃帳服務(wù)配置(ICBCServices)425.2工行對(duì)帳服務(wù)配置(BatchServices)615.3電子支付平臺(tái)到碼頭服務(wù)配置(SCTService)646使用和對(duì)接711 Oracle Service Bus 安裝點(diǎn)擊osb103_weblogic103_win32.exe建立BEA Home選擇Custom方式,并選擇所有選擇安裝JDK2 Oracle Service Bus域配置啟動(dòng)配置向?qū)onfiguration wizard(program-Oracle WebLogic-WebLogic Server 10gr3-Tools-Configurat
3、ion Wizard)選擇Create a new WebLogic domain,然后Next選擇Workshop for WebLogic10.3和Oracle Service Bus,然后Next輸入WebLogic管理控制臺(tái)用戶名密碼(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 - Oracle WebLogic -
4、 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在新建立的Oracle Service Bus項(xiàng)目下如圖建立以下目錄(Folder
5、),分別是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 Callout,主要是通過Java Callout方式來(lái)記日志3.3 建立
6、記Log的Java項(xiàng)目n 首先先在數(shù)據(jù)庫(kù)表中建立osblog表Create table osblog(Transno varchar(20),Message varchar(200),Transdate date);n 在WebLogic console中建立到數(shù)據(jù)庫(kù)的連接池,JNDI設(shè)置為XEn 建立Java Project,注意在build路徑下加入weblogic.jarn 先建立一個(gè)osbutility的package,然后新建OsbLogMessage類,代碼如下:package osbutility;import java.sql.Connection;import java.sq
7、l.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(String transno,String mess) Conne
8、ction con = null; Statement stmt = null; int val = 1;try Context ctx = null; Hashtable ht = new Hashtable(); ht.put(Context.INITIAL_CONTEXT_FACTORY,weblogic.jndi.WLInitialContextFactory); ht.put(Context.PROVIDER_URL,t3:/localhost:7001); ht.put(Context.SECURITY_PRINCIPAL, weblogic); ht.put(Context.SE
9、CURITY_CREDENTIALS, weblogic); ctx = new InitialContext(ht); javax.sql.DataSource ds= (javax.sql.DataSource) ctx.lookup(XE); con = ds.getConnection(); String sql = insert into osblog values(+transno+,+mess+,sysdate); System.out.println(sql); stmt = con.createStatement(); val = stmt.executeUpdate(sql
10、); catch (Exception e) System.out.println(e.getMessage(); finally try if (stmt != null) stmt.close(); if (con != 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管理控制臺(tái)http:/localhost:7
11、001/console新建Services-JDBC-DataSource其他選擇缺省設(shè)置,并且設(shè)置用戶名密碼,測(cè)試通過部署到AdminServer就可3.5 配置Queue(對(duì)帳交易中用到)1) 選擇Services-Messaging-JMS Modules,建立CHModule選擇部署到AdminServer2) 新建JMS Servers同時(shí)部署到AdminServer3) 在CHModule中建立ConnectionFactory4) 然后新建Queue5) 選擇新建Subdeployment如圖完成3.6 建立對(duì)Socket Transport的支持1) 先在cmd下轉(zhuǎn)到需要部署的
12、Oracle Service Bus domain目錄(如E:beauser_projectsdomainsCH_domainbin),運(yùn)行SetDomainEnv.cmd2) 在cmd下轉(zhuǎn)到相應(yīng)的Socket Transport的安裝目錄(如E:beaosb_10.3samplesservicebussample-transport),修改在E:beaosb_10.3samplesservicebussample-transportsrccombeaalsbtransportssock中的SocketTransportUIBinding.java,主要修改方法為: (藍(lán)色)public bo
13、olean isServiceTypeSupported(BindingTypeInfo bindingType) return true; /* try BindingTypeInfo.BindingTypeEnum type = bindingType.getType(); if (type.equals(BindingTypeInfo.BindingTypeEnum.MIXED) BindingTypeInfo.MessageTypeEnum responseMessageType = bindingType.getResponseMessageType(); if (responseM
14、essageType != null) if (!( BindingTypeInfo.MessageTypeEnum.TEXT.equals(responseMessageType) | BindingTypeInfo.MessageTypeEnum.XML .equals(responseMessageType) return false; BindingTypeInfo.MessageTypeEnum requestMessageType = bindingType.getRequestMessageType(); if (requestMessageType != null) retur
15、n BindingTypeInfo.MessageTypeEnum.TEXT.equals(requestMessageType) | BindingTypeInfo.MessageTypeEnum.XML.equals(requestMessageType); else return false; return type.equals(BindingTypeInfo.BindingTypeEnum.ABSTRACT_XML) | type.equals(BindingTypeInfo.BindingTypeEnum.XML); catch (TransportException e) Soc
16、ketTransportUtil.logger.error(e.getLocalizedMessage(), e); return false; */ 3) 修改SocketOutBoundMessageContext.javaRun方法主要決定如何處理從后端系統(tǒng)的返回,修改的部分如藍(lán)色public void run() try / if the end-point is one-way, dont read the response. if (!epc.getRequestResponse() SocketTransportMessagesLogger.oneWayEndpoint(); l
17、istener.onReceiveResponse(SocketOutboundMessageContext.this); return; String resEnc = getResponseEncoding(); responseMetadata = new SocketResponseMetaData(resEnc); InetAddress inetAddress = clientSocket.getInetAddress(); responseMetadata.setEndPointHost(inetAddress.getHostName(); responseMetadata.se
18、tEndPointIP(inetAddress.getHostAddress(); / Reading the response from the external service. InputStream inputStream = clientSocket.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader(inputStream, resEnc); int i = -1; StringBuilder sb = new StringBuilder(); char buff = new c
19、har512; while (true) i = inputStreamReader.read(buff); if (i = -1) break; sb.append(buff, 0, i); /* if it ends with double CRLF, 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 mes
20、sage. */ if (i = sb.indexOf(SocketTransportUtil.FIN_FLAG) != -1) break; if (i != -1) / strip rnrn from the message. String msg = sb.substring(0, i+2); responseIS = new ByteArrayInputStream(msg.getBytes(resEnc); listener.onReceiveResponse(SocketOutboundMessageContext.this); else / Message format is w
21、rong, it should end with rnrn listener.onError(SocketOutboundMessageContext.this, TransportManager.TRANSPORT_ERROR_GENERIC, SocketTransportMessagesLogger.invalidMessage(); catch (IOException e) SocketTransportUtil.logger.error(e.getLocalizedMessage(), e); listener.onError(SocketOutboundMessageContex
22、t.this, TransportManager.TRANSPORT_ERROR_GENERIC, e.getLocalizedMessage(); catch (TransportException trex) SocketTransportUtil.logger.error(trex.getLocalizedMessage(), trex); listener.onError(SocketOutboundMessageContext.this, TransportManager.TRANSPORT_ERROR_GENERIC, trex.getLocalizedMessage(); fin
23、ally try clientSocket.close(); catch (IOException e) SocketTransportUtil.logger.error(e.getLocalizedMessage(), e); 4) Send則決定如何把信息從OSB發(fā)給后端系統(tǒng),改動(dòng)部分如藍(lán)色:public void send(final TransportSendListener listener) throws TransportException String address = options.getURI().toString(); try String host = null;
24、int port = 0; try URI uri = new URI(address); host = uri.getHost(); port = uri.getPort(); catch (URISyntaxException e) new TransportException(e.getMessage(), e); SocketTransportMessagesLogger.ipAddress(host, port); final Socket clientSocket = new Socket(host, port); SocketEndpointConfiguration socke
25、tEndpointConfiguration = SocketTransportUtil.getConfig(config); SocketOutboundPropertiesType outboundProperties = socketEndpointConfiguration.getOutboundProperties(); clientSocket.setTcpNoDelay(!outboundProperties.getEnableNagleAlgorithm(); clientSocket.setSoTimeout(outboundProperties.getTimeout();
26、String reqEnc = socketEndpointConfiguration.getRequestEncoding(); if (reqEnc = null) reqEnc = utf-8; / Send the message to the external service. OutputStream outputStream = clientSocket.getOutputStream(); TransformOptions transformOptions = new TransformOptions(); transformOptions.setCharacterEncodi
27、ng(reqEnc); sender.getPayload().writeTo(outputStream, transformOptions); /outputStream.write(SocketTransportUtil.D_CRLF.getBytes(reqEnc); outputStream.flush(); SocketTransportMessagesLogger.flushed(); PipelineAcknowledgementTask task = new PipelineAcknowledgementTask(listener, clientSocket, socketEn
28、dpointConfiguration); TransportManagerHelper .schedule(task, socketEndpointConfiguration.getDispatchPolicy(); catch (UnknownHostException e) SocketTransportUtil.logger.error(e.getLocalizedMessage(); throw new TransportException(e.getMessage(), e); catch (IOException e) SocketTransportUtil.logger.err
29、or(e.getLocalizedMessage(); throw new TransportException(e.getMessage(), e); catch (TransformException e) SocketTransportUtil.logger.error(e.getLocalizedMessage(); throw new TransportException(e.getMessage(), e); catch (TransportException e) SocketTransportUtil.logger.error(e.getLocalizedMessage();
30、throw e; 5) 轉(zhuǎn)到相應(yīng)的Socket Transport的安裝目錄(如E:beaosb_10.3samplesservicebussample-transport),運(yùn)行ant clean6) 運(yùn)行ant build-jar7) 運(yùn)行ant deploy3.7 電子支付平臺(tái)與碼頭接口配置i. 在Weblogic Workshop中創(chuàng)建一個(gè)支持XMLBean的Web Service Projectii. 在項(xiàng)目底下的“Schema”文件夾中新建一個(gè)Schema:iii. 編輯該Schema文件,將接口中需要用到的數(shù)據(jù)結(jié)構(gòu)定義在該Schema文件中: iv. 在“src”文件夾下創(chuàng)建包及
31、Web Service:v. 在”InterfaceSCT.java”文件中實(shí)現(xiàn)與碼頭的接口:package ;import javax.jws.*;import org.example.serviceIntegrateSchema.*;WebServicepublic class InterfaceSCT /接口A paySuccessInfoWebMethodpublic void paySuccessInfo(String bankId,String feebillNo,PaySuccessInfoDocument bill_list) PaySuccessInfoList psil =
32、 bill_list.getPaySuccessInfo();int len = psil.getPaySuccessInfoElmList().size();for(int i = 0;ilen;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().sizeOfCNTRN
33、OArray();/接口B dayAccountWebMethodpublic DayTotalMoneyDocument dayAccount(long startdate,long enddate) DayTotalMoneyDocument dtm = DayTotalMoneyDocument.Factory.newInstance();DayTotalMoneyType dtmt = dtm.addNewDayTotalMoney();dtmt.setDayTotalMoney(1000000);return dtm;/接口C BillPayStatusWebMethodpublic BillPayStatusReturnDocument getBillPayStatus(BillPayStatusInputDocument bill_list,String iotype) BillPayStatusReturnDocument bpsr = BillPayStatusReturnDocument.Factory.newInstance();BillPayStatusInputLis
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 教育科技行業(yè)商業(yè)模式創(chuàng)新與產(chǎn)業(yè)鏈協(xié)同效應(yīng)研究報(bào)告
- 醫(yī)院反恐主題教育
- 城市管理執(zhí)法文書培訓(xùn)
- 河南省新鄉(xiāng)市新譽(yù)佳高級(jí)中學(xué)、永宏高級(jí)中學(xué)2024-2025學(xué)年高一下學(xué)期6月聯(lián)考語(yǔ)文試卷(含答案)
- 2025年暑假譯林版(2024)七年級(jí)升八年級(jí)英語(yǔ)每日一練06(含答案)
- 幼兒園彩泥培訓(xùn)
- 人員培訓(xùn)課程課件
- 支架取栓病例分享
- 電工基礎(chǔ)培訓(xùn)
- 農(nóng)行內(nèi)勤行長(zhǎng)培訓(xùn)總結(jié)
- 橋梁施工進(jìn)度圖
- 某啤酒廠安全現(xiàn)狀評(píng)價(jià)設(shè)計(jì)報(bào)告書模板
- 在線語(yǔ)言學(xué)習(xí)行業(yè)競(jìng)爭(zhēng)格局分析
- 廣西桂林市2022-2023學(xué)年高二下學(xué)期期末質(zhì)量檢測(cè)數(shù)學(xué)試題(含答案解析)
- 內(nèi)墻抹灰安全技術(shù)交底
- 中學(xué)美術(shù)校本教材《素描》
- 國(guó)開2023年春《理工英語(yǔ)1》機(jī)考網(wǎng)考期末復(fù)習(xí)資料參考答案
- 《幼兒生活活動(dòng)保育》課程標(biāo)準(zhǔn)
- 年出欄5萬(wàn)頭生豬養(yǎng)殖場(chǎng)建設(shè)項(xiàng)目及年出欄4800頭生豬養(yǎng)殖基地建設(shè)項(xiàng)目建議書
- OIF-CEI-04.0OIF-CEI-04.0高速電口標(biāo)準(zhǔn)
- 工程項(xiàng)目管理對(duì)應(yīng)丁士昭教材
評(píng)論
0/150
提交評(píng)論