📜 ⬆️ ⬇️

Development of BPEL business process stubs based on Oracle SOA Suite and Weblogic

In this article, I’ll explain how to implement BPEL business process web service stubs using Oracle SOA Suite and Weblogic server


Task


There is a project for load testing of one system. In the scheme of interaction between servers, there are external systems that do not participate in the test object — they must be replaced with emulators or plugs. SOAP protocol. Composites on BPEL. There is no stand. Terribly interesting!




Decision


Well, I think everything is simple. I will request WSDL, XSD schemas, examples of requests and responses. I'll take my favorite Eclipse, Tomcat, quickly generate classes, insert an example of the answer, then deploy and check.


Eclipse was very indignant: WSDL does not have the necessary information for the normal generation of classes. I began to edit it, register the endpoint, but it still did not work. Then I found out that this is a BPEL process, and it should be done differently.


BPEL itself is an XML-based language for formally describing business processes and protocols for their interaction with each other. And Eclipse can do it all, there are plugins, there is an Apache ODE application server. It seems that the project of a BPEL process in Eclipse must be collected manually; it does not create those files that are in the composite. Import of the unloaded composite from the functional stand also does not work. It was surprising if he imported the composite from Weblogic into Eclipse.


I thought to do it the same way as in production: Oracle Database + Oracle Weblogic + Oracle SOA Suite, development in Oracle JDeveloper.


Next, I will tell you about:



BPEL is an XML-based language for the formal description of business processes and protocols for their interaction with each other.


I must say that BPEL is quite a big and handy thing, allowing you to insert different operators, debag and pieces of code, such as Java.


The business process looks like this:




Let's turn our booth. And so, what do we need and which versions:



Unfolding your stand


Instructions for installing and configuring software


Weblogic installation
  1. Run the installer.


    java -jar wls1036_generic.jar 

  2. Select the path for the home folder.



  3. Skip registration for updates.



  4. Choose a typical installation.
    ')


  5. Specify the folder with the JDK.



  6. Next, we specify the folder where to put Weblogic.



  7. Installation and greetings.



Oracle installation

There is nothing difficult in the installation, I’ll dwell only on some moments.
Let's skip the minimum requirements and set up Oracle Database 11g Release 2 x32 for Windows, choose Desktop Class. We have enough for development.
On the Internet, including on Habré, there are many articles on installation. I will note only installation under the local administrator and the task of environment variables. Although the error with the absence of ORACLE_UNQNAME did not prevent and everything started.




Install SOA Suite
  1. To run the installer, you must specify the path to the JRE or JDK.


     ofm_soa_generic_11.1.1.7.0/Disk1/setup.exe -jreLoc c:\Oracle\Middleware\jdk160_24 

  2. Skip the update software.



  3. Checking the operating system and physical memory in case of an error can be ignored.



  4. Choosing Middleware Home and the directory name for our SOA.



  5. Next, the installer found Weblogic in the home folder.



  6. Installation and greetings. Check the connection.


     sqlplus sys@ORCL as sysdba 

  7. Or run SQL Developer and set up the connection.


     c:\app\admin\product\11.2.0\dbhome_1\sqldeveloper\sqldeveloper.exe 


Creating a repository for Oracle SOA using RCU
  1. Run RCU.


     ofm_rcu_win_11.1.1.7.0_64_disk1_1of1/rcuHome/bin/rcu.bat 

  2. Choose Create Repository.



  3. Specify the parameters of the database, in our case it is localhost, 1521, sys and password. Next comes the check.


  4. Next you need to specify the prefix for the data schema names (the default is DEV) and select the components of the repository, we need Metadata Services and SOA Infrastructure, the User Messaging Service is automatically selected.



  5. We specify the password for users, owners of data schemes for the repository.



  6. You can then select the tablespaces for the repository data schemas.



  7. Start creating tablespaces.



  8. Is done.




Creating a WebLogic domain and starting servers
  1. Run the installation.
    To create it, run the config.cmd file in the folder


     C:\Oracle\Middleware\Oracle_SOA1\common\bin 

    I have JDK 1.7, so he cursed


    We will go around it - change javaw to java in the file


     c:\Oracle\Middleware\wlserver_10.3\common\bin\config.cmd 

    and get the description of the Unrecognized VM option 'UseSpinning'
    Remove the option -XX: + UseSpinning (which is no longer with 1.6) in the file


     c:\Oracle\Middleware\wlserver_10.3\common\bin\commEnv.cmd 

    and run again.


  2. Select the creation of a new domain.



  3. We select Oracle SOA Suite, Enterprise Manager. WSM Policy Manager and JRF will be selected automatically.



  4. Specify the name and path to the domain and applications.



  5. Password for weblogic user.



  6. JDK and installation type. Leave Development Mode.



  7. We assign passwords to your schemes, host and sid :.



  8. Check.



  9. We will not configure, we will leave empty.



  10. Click to create.


  11. Is done. Run the admin server.



  12. Let's wait for the message "Server state changed to RUNNING"


  13. Run soa_server1.


     c:\Oracle\Middleware\user_projects\domains\base_domain\bin\startManagedWebLogic.cmd soa_server1 

  14. When will ask for a login and password, enter from the domain administrator. To no longer asked to create a file.


     c:\Oracle\Middleware\user_projects\domains\base_domain\servers\soa_server1\security\boot.properties 



     username=weblogic password=welcome1 


Check Consoles and Configure JDeveloper
  1. Verify the WebLogic Administration Console: http: // localhost: 7001 / console (if you used the default port during installation).



  2. Enterprise Manager Verification: http: // localhost: 7001 / em
    The Enterprise Manager should have the “SOA” tab available in the tree on the left.





  1. You need to install JDeveloper to create composites. We are taking version 11.1.1.9.0.
    Set using existing Middleware Home.


  2. To work with composites, you need to install an extension for our JDeveloper.








Preparation for development


Composites that we deploy will use schemas that are stored in MDS in the database. It can be requested or deflated from the stand for functional testing.


Connect to MDS and import archive
  1. Import MDS archive.





  2. Creating a database connection under an MDS user. View-> Resource palette-> New Connection-> Database



  3. Create a connection to MDS. View-> Resource palette-> New Connection-> SOA-MDS




Import existing composite
  1. Creating an empty project. (File-> New).







  2. Import existing composite. Composites can also be deflated from a functional stand. Select the created project, File-> Import.








Development


Scratch the composite and close


Cutting out calls to external systems. Editing a BPEL file

In the picture above you can see on the right side there is an external system and the business process is invoked by the invoke method.
Let's remove this unnecessary. I will do it in a notebook. But it is possible and in the interface.




  1. A brief digression.
    The file consists of blocks, variations more, I will list some:
    process - the root tag for the process
    partnerLinks - partnership agreements between services
    variables - declaration variables
    faultHandlers - error handlers
    sequence main - business process
    receive - receive a request from a client
    assign - the variable assignment block
    copy - copy data from one object to another
    invoke - a web service call
    if, elseif, else - conditions declaration
    condition - condition description
    forEach - cycle declaration
    startCounterValue - start of the loop
    finalCounterValue - end of loop
    scope - union


  2. Remove part of the agreement concerning the external system.


     <partnerLink name="GetCustomerPartyAccountBS" partnerLinkType="ns2:GetCustomerPartyAccount" partnerRole="GetCustomerPartyAccountProvider" myRole="GetCustomerPartyAccountRequester"/> 

  3. For simplicity, I also delete the error handler. The entire tag is faultHandlers.


     <faultHandlers/> 

  4. We remove the assign request to the external system, leaving only the copying of data from the request to identify the request.


     <copy> <from>$inputVariable.payload/SYSTEM/MSG_ID/@Value</from> <to>$outputVariable.payload/SYSTEM/MAIN_ID/@Value</to> </copy> 

  5. We delete all calls to the external invoke systems, except the last one in the file where the response to our client should be.


     <invoke name="callbackClient" partnerLink="getcustomerpartyaccountsystreqa_client" portType="ns1:GetCustomerPartyAccountsystReqACallback" operation="processResponse" inputVariable="outputVariable"/> 

  6. Let's look at the variable in which to write the answer. In our case, this is the outputVariable


  7. We take the example of the answer that our developers gave in a friendly way, or we ourselves pulled it out of the SOA on a functional stand. And write the values ​​in the right tags. for example
    The payload method, the response operation AnsSearchGetCustomerPartyAcc and xpath set our own.
    BEGIN [$ itr] - an element in the loop, means the $ itr -th element of BEGIN inside the parent.



  <copy bpelx:insertMissingToData="yes" ignoreMissingFromData="yes"> <from>"0"</from> <to>$outputVariable.payload/DATA/AnsSearchGetCustomerPartyAcc/BEGIN_/accClntList/BEGIN_[$itr]/accClnt/BEGIN_/status/BEGIN_/code/@Value</to> </copy> 

Cutting out calls to external systems. Rule composit.xml
  1. Remove the wsdl import from the external service.
     <import importType="wsdl" location="oramds:/apps/EDM/EnterpriseBusinessServiceLibrary/GetCustomerPartyAccountBS/V1/GetCustomerPartyAccountBSV1.wsdl" namespace="http://www.ru/EnterpriseBusinessServiceLibrary/GetCustomerPartyAccountBS/V1"/> 
  2. Remove another link to an external service.
     <reference name="GetCustomerPartyAccountBS"> 
  3. And another wire connection to the service GetCustomerPartyAccountBS
     <wire> ```GetCustomerPartyAccountsystReqA/GetCustomerPartyAccountBS</source.uri> <target.uri>GetCustomerPartyAccountBS</target.uri> </wire> 

Cutting out calls to external systems. Rule .componentType and soaconfigplan.xml
  1. We remove the link to the external service in these files.
     <reference name="GetCustomerPartyAccountBS"> 
  2. We try to collect. Right Click on the project -> Make.
    If everything is OK, then deploy, no - we understand.

Deploy stubs on local weblogic
  1. We try to cover it.



  2. The choice of operation.



  3. You can create several services with the same name but different versions.
    You can call everything, but only default revisions will work at the standard address. In Enterprise Manager, you can apply a default on a composite.



  4. Server selection.



  5. Add a local server. We press plus.





  6. Select SOA server.



  7. Summary.



  8. Deploy log




Examples of the use of operators

Some examples of interesting features.


  1. Regular expressions.


     <if name="If_ChooseSync"> <documentation>sender_bic</documentation> <condition>xp20:matches($sender_bic,'(?!044525716|046577413|044030811|043602955|045004751|042007738|040349585|040813827)\d{9}') = true()</condition> ... 

  2. Assign string


     <extId Value="0000000001CA3B1"/> 

     <copy ignoreMissingFromData="yes" bpelx:insertMissingToData="yes"> <from>"0000000001CA3B1"</from> <to>$CITResponse/DATA/ReqSyncFinancialTransactionBatch/BEGIN_/documentList/BEGIN_/document/BEGIN_/extId/@Value</to> </copy> 

  3. Cycle and iterator.


     <forEach parallel="no" counterName="ForEach1CounterSync" name="ForEachSync"> <startCounterValue>1</startCounterValue> <finalCounterValue>count($onMessage_ExecuteFinancialTransactionBatch_InputVariable.part1/DATA/ReqExecFinancialTransactionBatch/BEGIN_/documentList/BEGIN_)</finalCounterValue> ... 

  4. Use an iterator in a loop.


     <copy ignoreMissingFromData="yes" bpelx:insertMissingToData="yes"> <from>"BQ.00000.1415807097.277059967"</from> <to>$CITResponse/DATA/ReqSyncFinancialTransactionBatch/BEGIN_/documentList/BEGIN_[$ForEach1CounterInc]/document/BEGIN_/extId/@Value</to> </copy> 

  5. Many built-in functions, such as guid generation.


     <copy> <from>oraext:generate-guid()</from> <to>$CITResponse/SYSTEM/MSG_ID/@Value</to> </copy> 

  6. Or a comparison.


     <condition>xp20:compare($sender_bic,$recipient_bic) != 0</condition> 

  7. Tasty. You can insert Java.


     <extensionActivity> <bpelx:exec language="java"> <![CDATA[XMLElement elem = (XMLElement) getVariableData("output", "payload"); String t = elem.getTextContent(); elem.setTextContent(t + ", set by java exec 2");]]> </bpelx:exec> </extensionActivity> 


Adding to the composite service call

There is a business process that calls an external system, which after some time makes a request to the system under test. This is not in our business process.
We need to set up partnership agreements with the new service, set the variables and insert the invoke of the service with the ReqSyncFinancialTransactionBatch request into our business process.
The service provider that accepts the ReqSyncFinancialTransactionBatch request is also built on SOA and, by good coincidence, there is a composite from it.
It is necessary to unpack and drag it all that relates to the call provider in our composite.


  1. We add name spaces from provider and type of request to the list.


     xmlns:ns27="urn:syst-ws:ws_soap-provider_ta" xmlns:ns28="http://www.mybank.ru/ApplicationObjectLibrary/syst/Providers/DistributedFinancialTransactionProcessingBatchsystProvA/V1/SyncFinancialTransactionBatch_Request" 

  2. Add affiliate agreement.


     <import namespace="urn:syst-ws:ws_soap-provider_ta" location="oramds:/apps/EDM/mybank/ApplicationObjectLibrary/syst/wsdls/ProviderTA/V1/PROVIDER_TA.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> 

  3. I also needed to import the schemas.


     <import namespace="urn:syst-ws:ws_soap-provider_ta" location="oramds:/apps/EDM/mybank/ApplicationObjectLibrary/syst/wsdls/ProviderTA/V1/PROVIDER_TA.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> <import namespace="http://www.mybank.ru/ApplicationObjectLibrary/syst/Providers/DistributedFinancialTransactionProcessingBatchsystProvA/V1/SyncFinancialTransactionBatch_Request" location="oramds:/apps/EDM/mybank/ApplicationObjectLibrary/syst/schemas/Providers/DistributedFinancialTransactionProcessingBatchsystProvA/V1/SyncFinancialTransactionBatch_Request.xsd" importType="http://www.w3.org/2001/XMLSchema"/> 

  4. We write the variables.


     <variable name="CITResponse" element="ns28:CIT_REQUEST"/> <variable name="processPutSoapIn" messageType="ns27:PROCESSPUTSoapIn"/> 

  5. We make the assignments in the new request, where necessary in accordance with the scheme.


     <assign name="AssignOK"> <copy ignoreMissingFromData="yes" bpelx:insertMissingToData="yes"> <from>"cm.System.syst"</from> <to>$CITResponse/DATA/ReqSyncFinancialTransactionBatch/BEGIN_/systemTo/@Value</to> </copy> <copy ignoreMissingFromData="yes" bpelx:insertMissingToData="yes"> <from>"cm.System.BQ"</from> <to>$CITResponse/DATA/ReqSyncFinancialTransactionBatch/BEGIN_/systemFrom/@Value</to> </copy> <copy ignoreMissingFromData="yes" bpelx:insertMissingToData="yes"> <from>$onMessage_ExecuteFinancialTransaction_InputVariable.part2/DATA/ReqExecFinancialTransaction/BEGIN_/document/BEGIN_/id/@Value</from> <to>$CITResponse/DATA/ReqSyncFinancialTransactionBatch/BEGIN_/documentList/BEGIN_/document/BEGIN_/id/@Value</to> </copy> </assign> 

  6. Assigning a variable to an input variable to call the service. We look in the wsdl provider for the message, which he understands.


     <wsdl:message name="PROCESSPUTSoapIn"> <wsdl:part name="parameters" element="tns:PROCESSPUT"/> </wsdl:message> 

     <assign name="assignResponse"> <copy ignoreMissingFromData="yes" bpelx:insertMissingToData="yes"> <from>$CITResponse</from> <to>$processPutSoapIn.parameters/ns27:REQUESTPUT</to> </copy> </assign> 

  7. Call the invoke service, and read the answer, receive, if needed.
    If necessary, put the necessary headers to the request using bpelx: toProperties.


     <sequence> <invoke name="sendResponse" inputVariable="processPutSoapIn" partnerLink="ProviderTAWSImport" portType="ns27:PROVIDER_TASoap" operation="Async_PROCESSPUT" bpelx:invokeAsDetail="no"> <bpelx:toProperties> <bpelx:toProperty name="replyToAddress">'null'</bpelx:toProperty> </bpelx:toProperties> </invoke> <receive name="receiveResponse" createInstance="no" partnerLink="ProviderTAWSImport" portType="ns27:PROVIDER_TACallbackSoap" operation="Async_PROCESSPUTCallback" variable="processPutSoapOut" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"/> </sequence> 

  8. Add a relation to the new service in the .componentType file


     ... <reference name="ProviderTAWSImport" ui:wsdlLocation="PROVIDER_TAWrapper.wsdl"> <interface.wsdl interface="urn:syst-ws:ws_soap-provider_ta#wsdl.interface(PROVIDER_TASoap)" callbackInterface="urn:syst-ws:ws_soap-provider_ta#wsdl.interface(PROVIDER_TACallbackSoap)"/> </reference> </componentType> 

  9. Put the wsdl PROVIDER_TAWrapper.wsdl from the service to our project


  10. Add reference to the cfgplan file


     <composite name="DistributedFinancialTransactionProcessingBatchsystReqA"> <reference name="ProviderTAWSImport"> <binding type="ws"> <attribute name="location"> <replace>@@@systDistributedFinancialTransactionProviderTAWSDL@@@</replace> </attribute> <property name="oracle.webservices.httpConnTimeout"> <replace>@@@systDistributedFinancialTransactionTAWSDL_httpConnTimeout@@@</replace> </property> <property name="oracle.webservices.httpReadTimeout"> <replace>@@@systDistributedFinancialTransactionTAWSDL_httpReadTimeout@@@</replace> </property> </binding> </reference> </composite> 

  11. Add the import wsdl, reference and wire to the file composit.xml
    Pay attention to the link to the service provider location = " http://k10systwp.mybank.ru:7030/webproxy/WS/PROVIDER_TA?wsdl


     <import importType="wsdl" location="PROVIDER_TAWrapper.wsdl" namespace="urn:syst-ws:ws_soap-provider_ta"/> <import importType="wsdl" location="PROVIDER_TAWrapper1.wsdl" namespace="urn:syst-ws:ws_soap-provider_ta"/> <import importType="wsdl" location="PROVIDER_TAWrapper2.wsdl" namespace="urn:syst-ws:ws_soap-provider_ta"/> 


  <reference name="ProviderTAWSImport" ui:wsdlLocation="oramds:/apps/EDM/mybank/ApplicationObjectLibrary/syst/wsdls/ProviderTA/V1/PROVIDER_TA.wsdl"> <interface.wsdl callbackInterface="urn:syst-ws:ws_soap-provider_ta#wsdl.interface(PROVIDER_TACallbackSoap)" interface="urn:syst-ws:ws_soap-provider_ta#wsdl.interface(PROVIDER_TASoap)"/> <binding.ws location="http://k10systwp.mybank.ru:7030/webproxy/WS/PROVIDER_TA?wsdl" port="urn:syst-ws:ws_soap-provider_ta#wsdl.endpoint(PROVIDER_TA/PROVIDER_TASoap)" soapVersion="1.1"> <property many="false" name="weblogic.wsee.wsat.transaction.flowOption" type="xs:string">WSDLDriven</property> </binding.ws> <callback> <binding.ws port="urn:syst-ws:ws_soap-provider_ta#wsdl.endpoint(PROVIDER_TA/PROVIDER_TACallbackSoap_pt)"/> </callback> </reference> 

  <wire> ```DistributedFinancialTransactionProcessingBatchsystReqA/ProviderTAWSImport</source.uri> <target.uri>ProviderTAWSImport</target.uri> </wire> 

  1. Everything, we try to collect and deploy

Composite testing


Check what we have done.


Check your service
  1. We take SoapUI, we generate mosk-service, using wsdl from the service we provide.
  2. We take an example of a request to our service, we write in the settings in ReplyTo the address of mosk, which we have just created. In Action we register operation. The picture is clickable.


  3. Make a request
  4. We look, the service has worked and sent a response. The picture is clickable.



Check embedded call service
  1. We also take SoapUI, we generate a mosk-service using wsdl from the service provider.
  2. We copy the address wsdl and we register it in the file composite.xml in our service. Thus we specify where the embedded query will go.
     <binding.ws location="http://k10-emul:8089/mockPROVIDER_TASoap?WSDL" port="urn:ws:ws_soap-provider_ta#wsdl.endpoint(PROVIDER_TA/PROVIDER_TASoap)" soapVersion="1.1"> 
  3. We save, deploy with another version. We also remove the tick in default so that our debug doesn’t bother anyone.


  4. Check that everything is assembled without errors and go to EM. We are looking for our service with a new revision.




  5. We make a request and check that the embedded call came to our stub. The picture is clickable.



Problem analysis at work


What to do if the developers say that our plug slows down, but everything is fine with them?
We'll figure out.


Search queries in the database SOA

It took to find requests for content to understand what happened to him. The CUBE_INSTANCE table in our DEV_SOAINFRA schema contains the entire history of composites. But for viewing it is necessary to pull it out of the blob.
Found here the function that does it


code
  CREATE OR REPLACE PACKAGE SOA_UTIL AS ------------------------------------------------------------------------------------------- -- Written by : Gilberto Holms (https://gibaholms.wordpress.com/) -- Last update : 07/11/2014 -- Version : 1.1 -- Description : Utility code to handle Oracle SOA Suite tables -- Release notes: -- 1.0: Initial release -- 1.1: Bug fix to work properly on SOA 10g ------------------------------------------------------------------------------------------- FUNCTION GET_AUDIT_TRAIL(P_SCHEMA_NAME VARCHAR2, P_CIKEY NUMBER) RETURN CLOB; END SOA_UTIL; / CREATE OR REPLACE PACKAGE BODY SOA_UTIL AS ------------------------------------------------------------------------------------------- -- Written by : Gilberto Holms (https://gibaholms.wordpress.com/) -- Last update : 07/11/2014 -- Version : 1.1 -- Description : Utility code to handle Oracle SOA Suite tables -- Release notes: -- 1.0: Initial release -- 1.1: Bug fix to work properly on SOA 10g ------------------------------------------------------------------------------------------- FUNCTION GET_AUDIT_TRAIL(P_SCHEMA_NAME VARCHAR2, P_CIKEY NUMBER) RETURN CLOB AS V_AUDIT_BLOB BLOB; V_AUDIT_CLOB CLOB; V_CUR_AUDIT SYS_REFCURSOR; TYPE TP_AUDIT_RECORD IS RECORD( BLOCK NUMBER(38,0), LOG BLOB ); TYPE TP_AUDIT_ARRAY IS TABLE OF TP_AUDIT_RECORD; V_AUDIT_ARRAY TP_AUDIT_ARRAY; V_AUDIT_COMPLETE BLOB; V_BUFFER_LENGTH PLS_INTEGER := 32767; V_BUFFER VARCHAR2(32767); V_READ_START PLS_INTEGER := 1; BEGIN DBMS_LOB.CREATETEMPORARY(V_AUDIT_BLOB, TRUE); DBMS_LOB.CREATETEMPORARY(V_AUDIT_CLOB, TRUE); DBMS_LOB.CREATETEMPORARY(V_AUDIT_COMPLETE, TRUE); OPEN V_CUR_AUDIT FOR 'SELECT BLOCK, LOG FROM ' || P_SCHEMA_NAME || '.AUDIT_TRAIL WHERE CIKEY = :cikey ORDER BY COUNT_ID' USING P_CIKEY; FETCH V_CUR_AUDIT BULK COLLECT INTO V_AUDIT_ARRAY; CLOSE V_CUR_AUDIT; FOR j IN 1..V_AUDIT_ARRAY.COUNT LOOP IF j = 1 THEN DBMS_LOB.APPEND (V_AUDIT_BLOB, V_AUDIT_ARRAY(j).LOG); ELSE IF ( V_AUDIT_ARRAY(j).BLOCK = V_AUDIT_ARRAY(j-1).BLOCK ) THEN DBMS_LOB.APPEND (V_AUDIT_BLOB, V_AUDIT_ARRAY(j).LOG); ELSE DBMS_LOB.APPEND (V_AUDIT_COMPLETE, UTL_COMPRESS.LZ_UNCOMPRESS(V_AUDIT_BLOB)); DBMS_LOB.CREATETEMPORARY(V_AUDIT_BLOB, TRUE); DBMS_LOB.APPEND (V_AUDIT_BLOB, V_AUDIT_ARRAY(j).LOG); END IF; END IF; END LOOP; DBMS_LOB.APPEND (V_AUDIT_COMPLETE, UTL_COMPRESS.LZ_UNCOMPRESS(V_AUDIT_BLOB)); V_AUDIT_ARRAY.DELETE; FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(V_AUDIT_COMPLETE) / V_BUFFER_LENGTH) LOOP V_BUFFER := UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(V_AUDIT_COMPLETE, V_BUFFER_LENGTH, V_READ_START)); DBMS_LOB.WRITEAPPEND(V_AUDIT_CLOB, LENGTH(V_BUFFER), V_BUFFER); V_READ_START := V_READ_START + V_BUFFER_LENGTH; END LOOP; RETURN V_AUDIT_CLOB; END; END SOA_UTIL; / 

and usage example


 SELECT ci.ecid, CI.COMPOSITE_NAME, SOA_UTIL.GET_AUDIT_TRAIL('DEV_SOAINFRA', CI.CIKEY) AS AUDIT_TRAIL_XML, ci.* FROM DEV_SOAINFRA.CUBE_INSTANCE CI WHERE CI.CREATION_DATE > to_date('21.04.2017 09:57:00','dd.mm.yyyy hh24:mi:ss') and CI.CREATION_DATE < to_date('21.04.2017 19:59:00','dd.mm.yyyy hh24:mi:ss') and CI.CREATION_DATE > sysdate-0.3 and SOA_UTIL.GET_AUDIT_TRAIL('DEV_SOAINFRA', CI.CIKEY) like '%40702810312080005917%'; 

Pictures are clickable.


  1. We are looking for a problem request. The picture is clickable.


  2. We take it ECID
  3. Go to EM and look for a query on ECID


  4. We look what happened and most importantly for what we answered the system





Monitoring and comments on work

There is nothing complicated


  1. For monitoring system resources and metrics soa there is a wonderful tab Perfomace summary.


  2. There is a script that will send soap requests to the stub every 30 seconds and measure the response time. You can tie it to anything, Grafana, Zabbix, Sitescope
  3. During the works, it was necessary to increase the memory for heap to 4096, the machine itself with 16 gb ram.
  4. As the query history grows, the soa schema also swells accordingly. It was necessary to expand the tablespace. The code can be found on the Internet, I will give just in case

Tablespace expansion
 ALTER TABLESPACE DEV_SOAINFRA ADD DATAFILE 'C:\APP\KALISTRATOVKA\ORADATA\ORCL\DEV_SOAINFRA07.DBF' size 20000M AUTOEXTEND ON NEXT 100M MAXSIZE 20000M; 

Table space size can be viewed in the dba_tablespace_usage_metrics table


Conclusion


For the unknown, you can and should take it and not be afraid to make a mistake. Yes, and I liked JDev more than Eclipse.


References to sources:


http://www.oracle-adf.info/2014/03/oracle-soa-suite.html
https://shouab.wordpress.com/oracle-soa-11g-step-by-step-installation-guide/
http://www.theserverside.com/news/1364554/BPEL-and-Java
http://samolisov.blogspot.ru/2009/06/soa-bpel.html
http://docs.oracle.com/cd/E15586_01/integration.1111/e10224/bp_java.htm
https://gibaholms.wordpress.com/2014/02/03/export-audit-trail-from-database-soa-10g-and-11g/

Source: https://habr.com/ru/post/307132/


All Articles