Pas Apicella
Working with Oracle JDeveloper 10g/11g, OAS 10g/OC4J, OFM 11g R1, Oracle Coherence and Oracle's Thin JDBC Driver.Pas Apicellahttp://www.blogger.com/profile/09389663166398991762noreply@blogger.comBlogger100125
Updated: 2 hours 33 min ago
Accessing the Oracle Universal Connection Pool MBean using JConsole
Now I am just tranistioning to the Oracle Universal Connection Pool I found that it has a useful MBean known as "UniversalConnectionPoolMBean" which you can view/manipulate with "jconsole" using JDK 1.6. Here is a screen shot of jconsole attached to the JVM which is has a Universal Connection Pool running within it. Once attached to the JVM access it as follows.
1. Click on the MBean tab
2. Click the + symbol for "oracle.ucp.admin.UniversalConnectionPoolMBean"
3. Click on the "Attributes" or "Methods" node and you can view/update the pool using that MBean
The javadoc for the MBean this can be found here.
http://download.oracle.com/docs/cd/B28359_01/java.111/e11990/oracle/ucp/admin/UniversalConnectionPoolManagerMBean.html
In the example below I was using Oracle's UCP within a coherence cache server for write behind to an Oracle database.
http://feeds.feedburner.com/TheBlasFromPas
1. Click on the MBean tab
2. Click the + symbol for "oracle.ucp.admin.UniversalConnectionPoolMBean"
3. Click on the "Attributes" or "Methods" node and you can view/update the pool using that MBean
The javadoc for the MBean this can be found here.
http://download.oracle.com/docs/cd/B28359_01/java.111/e11990/oracle/ucp/admin/UniversalConnectionPoolManagerMBean.html
In the example below I was using Oracle's UCP within a coherence cache server for write behind to an Oracle database.
http://feeds.feedburner.com/TheBlasFromPas
Categories: Fusion Middleware
Oracle Coherence - read-write-backing-map-scheme
I spent the last 2 weeks in Boston working with the oracle coherence team and how that product works and I am impressed with it. One thing which I was keen on testing out / learning in depth was the read-write-backing-map-scheme. I specifically wanted to learn write-behind which when enabled the cache will delay writes to the back end cache store, which in my example would be an Oracle 11g database. To me there is really only 2 options for this to be as quick as possible and of course use connection pooling which UCP (Oracle Universal Connection Pool) is perfect for.
1. JDBC Batching
2. PLSQL bulk binds
Whats important though is that we only commit after X amount of records, and only go to the database when we are ready to insert those X amount of records in a single round trip. To me PLSQL bulk binds make sense here, as all it takes is to convert those cache entries into an SQL object which the database can interpret from PLSQL. Once that's done your PLSQL is as simple as this really.
I will post a full example on this shortly which also shows how to read the data back into the cache.
More about this can be found here on what I want to setup. My initial testing showed 1,000,000 records inserted without too much issues BUT there are a couple of things to be aware from coherence and oracle itself.
http://coherence.oracle.com/display/COH35UG/Read-Through%2C+Write-Through%2C+Write-Behind+and+Refresh-Ahead+Cachinghttp://feeds.feedburner.com/TheBlasFromPas
1. JDBC Batching
2. PLSQL bulk binds
Whats important though is that we only commit after X amount of records, and only go to the database when we are ready to insert those X amount of records in a single round trip. To me PLSQL bulk binds make sense here, as all it takes is to convert those cache entries into an SQL object which the database can interpret from PLSQL. Once that's done your PLSQL is as simple as this really.
FORALL i IN mid.FIRST..mid.LAST
insert into messages (message_id, message_type, message)
values (mid(i), mt(i), m(i));
COMMIT;
I will post a full example on this shortly which also shows how to read the data back into the cache.
More about this can be found here on what I want to setup. My initial testing showed 1,000,000 records inserted without too much issues BUT there are a couple of things to be aware from coherence and oracle itself.
http://coherence.oracle.com/display/COH35UG/Read-Through%2C+Write-Through%2C+Write-Behind+and+Refresh-Ahead+Cachinghttp://feeds.feedburner.com/TheBlasFromPas
Categories: Fusion Middleware
Quick unix command to determine JDBC driver version
Thought this was alot easier then extracting the actual JDBC JAR file and viewing META-INF/MANIFEST.MF. Of course you can still use the JDBC API via DatabaseMetaData, but normally you don't need to go to that effort.
UNIX
> unzip -p ojdbc14.jar META-INF/MANIFEST.MF | grep -C 1 version
WINDOWS
> unzip -p ojdbc14.jar META-INF/MANIFEST.MF
Note: If you have grep.exe for windows you could use this.
> unzip -p ojdbc14.jar META-INF/MANIFEST.MF | grep -C version
Output (Unix demo)
------------------------
[oracle@beast lib]$ unzip -p ojdbc14.jar META-INF/MANIFEST.MF | grep -C 1 version
Manifest-Version: 1.0
Implementation-Version: "Oracle JDBC Driver version - 10.1.0.5.0"
Specification-Title: "Oracle JDBC driver classes for use with JDK1.4"
Specification-Version: "Oracle JDBC Driver version - 10.1.0.5.0"
Implementation-Title: "ojdbc14.jar"
If your using 11g JDBC driver then you can do it as follows.
http://theblasfrompas.blogspot.com/2007/09/fast-way-to-determine-exact-11g-jdbc.htmlhttp://feeds.feedburner.com/TheBlasFromPas
UNIX
> unzip -p ojdbc14.jar META-INF/MANIFEST.MF | grep -C 1 version
WINDOWS
> unzip -p ojdbc14.jar META-INF/MANIFEST.MF
Note: If you have grep.exe for windows you could use this.
> unzip -p ojdbc14.jar META-INF/MANIFEST.MF | grep -C version
Output (Unix demo)
------------------------
[oracle@beast lib]$ unzip -p ojdbc14.jar META-INF/MANIFEST.MF | grep -C 1 version
Manifest-Version: 1.0
Implementation-Version: "Oracle JDBC Driver version - 10.1.0.5.0"
Specification-Title: "Oracle JDBC driver classes for use with JDK1.4"
Specification-Version: "Oracle JDBC Driver version - 10.1.0.5.0"
Implementation-Title: "ojdbc14.jar"
If your using 11g JDBC driver then you can do it as follows.
http://theblasfrompas.blogspot.com/2007/09/fast-way-to-determine-exact-11g-jdbc.htmlhttp://feeds.feedburner.com/TheBlasFromPas
Categories: Fusion Middleware
Trace/Diagnostics output from ADF BC Web Services using FMC (EM) in OFM 11g R1
When you deploy your ADF BC Application module as a Web Service interface you can take advantage of Fusion Middleware Contol (EM) to trace the web service execution from FMC (EM) itself as I will show here.
Note: This is only applicable to ADF BC Web Services, the same steps won't work for JAX-WS or PLSQL web services created in JDeveloper 11g R1.
The documentation for Service-Enabled application modules can be found here.
Oracle® Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework
11g Release 1 (11.1.1)
Part Number B31974-03
11 Integrating Service-Enabled Application Modules
http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcextservices.htm#CJAJGIEB
In order to do this we need to achieve 3 steps here.
1. Setup Fusion Middleware Control (EM) in your domain
In short your domain will need to be setup as per these steps.
http://theblasfrompas.blogspot.com/2009/07/installing-adf-runtime-on-oracle-fusion.html
2. Deploy an ADF BC App Module as a Web Service Interface
Note: It is assumed you have a client method exposed in your ADF BC application module. An example of such a method is as follows. You will need to ensure the method is exposed as a client method.
2.1. Right click on your application module XML file and and select "Open {app module name}"
2.2. Select "Service Interface"
2.3. Select the + symbol
2.4. Enter in the service interface details.
2.5. Click next
2.6. Shuttle across the methods you wish to expose.
2.7. Ignore the "Service View Instances" and click next
2.8 Click Finish.
You end up with something as follows in the application navigator.

2.9. Now we need to create a deployment profile which we do by double clicking on the proejct to invoke the "Project properties" dialog.
2.10. Select "deployment"
2.11. Click New
2.12. Select the archive type as "Business Components service Interface"
2.13. Give it a name and press Ok
At this point you have created an EJB JAR file , which you can deploy by using the menu item for the workspace "Deploy" and targeting an Application Server Connection for your OFM 11g R1 server. Once deployed you should end up with output as follows.
[10:38:37 AM] ---- Deployment started. ----
[10:38:37 AM] Target platform is (Weblogic 10.3).
[10:38:44 AM] Entering Target Selection Dialog
[10:38:48 AM] Retrieving existing application information
[10:38:48 AM] Running dependency analysis...
[10:38:48 AM] Building...
[10:38:49 AM] Deploying 3 profiles...
[10:38:49 AM] Wrote EJB Module to D:\jdev11gr1\jdeveloper\jdev\mywork\ADFBC-WS\Demo\deploy\ADFBC-WS-Demo-context-root.jar
[10:38:50 AM] Wrote Archive Module to D:\jdev11gr1\jdeveloper\jdev\mywork\ADFBC-WS\Demo\deploy\adfbc-ws_Common.jar
[10:38:50 AM] Wrote Enterprise Application Module to D:\jdev11gr1\jdeveloper\jdev\mywork\ADFBC-WS\deploy\Demo_adfbc-ws.ear
[10:38:52 AM] INFO: Unable to load annotation weblogic.javaee.CallByReferencefor parsing. The annotation is ignored.
[10:38:52 AM] INFO: Unable to load annotation weblogic.javaee.CallByReferencefor parsing. The annotation is ignored.
[10:38:52 AM] INFO: GenericWSWarAnnotationListener.parseAnnotatedClass Adding Servlet Mapping with URL pattern /AppModuleService for annotated WebService class pas.au.adf.ws.server.serviceinterface.AppModuleServiceImpl
[10:38:54 AM] Deploying Application...
[10:38:59 AM] [Deployer:149191]Operation 'deploy' on application 'Demo_adfbc-ws' is initializing on 'debug_ws'
[10:39:16 AM] [Deployer:149192]Operation 'deploy' on application 'Demo_adfbc-ws' is in progress on 'debug_ws'
[10:39:21 AM] [Deployer:149194]Operation 'deploy' on application 'Demo_adfbc-ws' has succeeded on 'debug_ws'
[10:39:21 AM] Application Deployed Successfully.
[10:39:21 AM] Elapsed time for deployment: 43 seconds
[10:39:21 AM] ---- Deployment finished. ----
3. Use FMC (EM) to trace the ADF BC web service execution.
3.1 Log into FMC (EM) as follows
http://{server}:{port}/em
3.2 In the navigator pane, expand WebLogic Domain
3.3. Expand the domain
3.4. Select the desired server from the list.
3.5. From the WebLogic Sever menu, select Logs > Log Configuration
3.6. On the "Log Levels" tab you need to select "Loggers with persistent Log Level State", then expand the "Specify Loggers"
3.7. At the bottom and enter the logger name "oracle.webservices" and optionally setup the " Diagnostic Logging Level" you wish to use.
3.8. Press Apply.
Now at this point we have to restart the server.
Once re-started log back into EM and verify the Log configuration shows "oracle.webservices" as shown below.

Now we can test our web services as shown in this entry and verify we get web services diagnostics logging placed into the log file "debug_ws-diagnostic.log" which would be in a directory as follows $DOMAIN_HOME/servers/{managed-server-name}/logs
http://theblasfrompas.blogspot.com/2009/09/web-services-security-in-ofm-11g-r1.html
An example of the output is as follows
You can also view the log file from FMC (EM) as follows:
- From the WebLogic Sever menu, select Logs > View Log Messages
- Click on "Target Log Files" button.
- In the log files table select the row containing "debug_ws-diagnostic.log" and press the button "View Log File".
More Information
Oracle® Fusion Middleware Security and Administrator's Guide for Web Services
11g Release 1 (11.1.1)
Part Number B32511-01
15 Diagnosing Problems
http://download.oracle.com/docs/cd/E12839_01/web.1111/b32511/diagnosing.htm#WSSEC1226http://feeds.feedburner.com/TheBlasFromPas
Note: This is only applicable to ADF BC Web Services, the same steps won't work for JAX-WS or PLSQL web services created in JDeveloper 11g R1.
The documentation for Service-Enabled application modules can be found here.
Oracle® Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework
11g Release 1 (11.1.1)
Part Number B31974-03
11 Integrating Service-Enabled Application Modules
http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcextservices.htm#CJAJGIEB
In order to do this we need to achieve 3 steps here.
1. Setup Fusion Middleware Control (EM) in your domain
In short your domain will need to be setup as per these steps.
http://theblasfrompas.blogspot.com/2009/07/installing-adf-runtime-on-oracle-fusion.html
2. Deploy an ADF BC App Module as a Web Service Interface
Note: It is assumed you have a client method exposed in your ADF BC application module. An example of such a method is as follows. You will need to ensure the method is exposed as a client method.
public String getVersion ()
{
return getSession().getVersion();
}
2.1. Right click on your application module XML file and and select "Open {app module name}"
2.2. Select "Service Interface"
2.3. Select the + symbol
2.4. Enter in the service interface details.
2.5. Click next
2.6. Shuttle across the methods you wish to expose.
2.7. Ignore the "Service View Instances" and click next
2.8 Click Finish.
You end up with something as follows in the application navigator.

2.9. Now we need to create a deployment profile which we do by double clicking on the proejct to invoke the "Project properties" dialog.
2.10. Select "deployment"
2.11. Click New
2.12. Select the archive type as "Business Components service Interface"
2.13. Give it a name and press Ok
At this point you have created an EJB JAR file , which you can deploy by using the menu item for the workspace "Deploy" and targeting an Application Server Connection for your OFM 11g R1 server. Once deployed you should end up with output as follows.
[10:38:37 AM] ---- Deployment started. ----
[10:38:37 AM] Target platform is (Weblogic 10.3).
[10:38:44 AM] Entering Target Selection Dialog
[10:38:48 AM] Retrieving existing application information
[10:38:48 AM] Running dependency analysis...
[10:38:48 AM] Building...
[10:38:49 AM] Deploying 3 profiles...
[10:38:49 AM] Wrote EJB Module to D:\jdev11gr1\jdeveloper\jdev\mywork\ADFBC-WS\Demo\deploy\ADFBC-WS-Demo-context-root.jar
[10:38:50 AM] Wrote Archive Module to D:\jdev11gr1\jdeveloper\jdev\mywork\ADFBC-WS\Demo\deploy\adfbc-ws_Common.jar
[10:38:50 AM] Wrote Enterprise Application Module to D:\jdev11gr1\jdeveloper\jdev\mywork\ADFBC-WS\deploy\Demo_adfbc-ws.ear
[10:38:52 AM] INFO: Unable to load annotation weblogic.javaee.CallByReferencefor parsing. The annotation is ignored.
[10:38:52 AM] INFO: Unable to load annotation weblogic.javaee.CallByReferencefor parsing. The annotation is ignored.
[10:38:52 AM] INFO: GenericWSWarAnnotationListener.parseAnnotatedClass Adding Servlet Mapping with URL pattern /AppModuleService for annotated WebService class pas.au.adf.ws.server.serviceinterface.AppModuleServiceImpl
[10:38:54 AM] Deploying Application...
[10:38:59 AM] [Deployer:149191]Operation 'deploy' on application 'Demo_adfbc-ws' is initializing on 'debug_ws'
[10:39:16 AM] [Deployer:149192]Operation 'deploy' on application 'Demo_adfbc-ws' is in progress on 'debug_ws'
[10:39:21 AM] [Deployer:149194]Operation 'deploy' on application 'Demo_adfbc-ws' has succeeded on 'debug_ws'
[10:39:21 AM] Application Deployed Successfully.
[10:39:21 AM] Elapsed time for deployment: 43 seconds
[10:39:21 AM] ---- Deployment finished. ----
3. Use FMC (EM) to trace the ADF BC web service execution.
3.1 Log into FMC (EM) as follows
http://{server}:{port}/em
3.2 In the navigator pane, expand WebLogic Domain
3.3. Expand the domain
3.4. Select the desired server from the list.
3.5. From the WebLogic Sever menu, select Logs > Log Configuration
3.6. On the "Log Levels" tab you need to select "Loggers with persistent Log Level State", then expand the "Specify Loggers"
3.7. At the bottom and enter the logger name "oracle.webservices" and optionally setup the " Diagnostic Logging Level" you wish to use.
3.8. Press Apply.
Now at this point we have to restart the server.
Once re-started log back into EM and verify the Log configuration shows "oracle.webservices" as shown below.

Now we can test our web services as shown in this entry and verify we get web services diagnostics logging placed into the log file "debug_ws-diagnostic.log" which would be in a directory as follows $DOMAIN_HOME/servers/{managed-server-name}/logs
http://theblasfrompas.blogspot.com/2009/09/web-services-security-in-ofm-11g-r1.html
An example of the output is as follows
<anonymous>
] [ecid: 0000IFdFy2wFw000jzwkno1Aidcd00003S,0:3] [WEBSERVICE_PORT.name:
AppModuleServiceSoapHttpPort] [APP: Demo_adfbc-ws] [J2EE_MODULE.name:
ADFBC-WS-Demo-context-root] [WEBSERVICE.name: AppModuleService]
[J2EE_APP.name: Demo_adfbc-ws] Incomplete connection information
[2009-09-24T09:32:46.827+10:00] [debug_ws] [WARNING] []
[oracle.adf.share.jndi.ReferenceStoreHelper] [tid: [ACTIVE].ExecuteThread:
'2' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId:
<anonymous>
] [ecid: 0000IFdFy2wFw000jzwkno1Aidcd00003S,0:3] [WEBSERVICE_PORT.name:
AppModuleServiceSoapHttpPort] [APP: Demo_adfbc-ws] [J2EE_MODULE.name:
ADFBC-WS-Demo-context-root] [WEBSERVICE.name: AppModuleService]
[J2EE_APP.name: Demo_adfbc-ws] Incomplete connection reference object
[2009-09-24T09:32:50.828+10:00] [debug_ws] [TRACE] [OWS-04010]
[oracle.webservices.service] [tid: [ACTIVE].ExecuteThread: '2' for queue:
'weblogic.kernel.Default (self-tuning)'] [userId:
<anonymous>
] [ecid: 0000IFdFy2wFw000jzwkno1Aidcd00003S,0:3] [SRC_CLASS:
oracle.j2ee.ws.server.ServerMessages] [APP: Demo_adfbc-ws] [SRC_METHOD:
fineMsgServletResponse] [arg:
{/pas/au/adf/ws/common/}AppModuleServiceSoapHttpPort] [arg:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
<ns0:getVersionResponse xmlns:ns0="/pas/au/adf/ws/common/types/">
<result xmlns="/pas/au/adf/ws/common/types/">11.1.1.54.7</result>
</ns0:getVersionResponse>
</env:Body>
</env:Envelope>
] The SOAP response for port:
{/pas/au/adf/ws/common/}AppModuleServiceSoapHttpPort is:[[
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
<ns0:getVersionResponse xmlns:ns0="/pas/au/adf/ws/common/types/">
<result xmlns="/pas/au/adf/ws/common/types/">11.1.1.54.7</result>
</ns0:getVersionResponse>
</env:Body>
</env:Envelope>
]]
</anonymous>
</anonymous>
</anonymous>
You can also view the log file from FMC (EM) as follows:
- From the WebLogic Sever menu, select Logs > View Log Messages
- Click on "Target Log Files" button.
- In the log files table select the row containing "debug_ws-diagnostic.log" and press the button "View Log File".
More Information
Oracle® Fusion Middleware Security and Administrator's Guide for Web Services
11g Release 1 (11.1.1)
Part Number B32511-01
15 Diagnosing Problems
http://download.oracle.com/docs/cd/E12839_01/web.1111/b32511/diagnosing.htm#WSSEC1226http://feeds.feedburner.com/TheBlasFromPas
Categories: Fusion Middleware
Trace/Diagnostics output from ADF BC WS using FMC (EM) in OFM 11g R1
When you deploy your ADF BC Application module as a Web Service interface you can take advantage of Fusion Middleware Contol (EM) to trace the web service execution from FMC (EM) itself as I will show here.
Note: This is only applicable to ADF BC Web Services, the same steps won't work for JAX-WS or PLSQL web services created in JDeveloper 11g R1.
The documentation for Service-Enabled application modules can be found here.
Oracle® Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework
11g Release 1 (11.1.1)
Part Number B31974-03
11 Integrating Service-Enabled Application Modules
http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcextservices.htm#CJAJGIEB
In order to do this we need to achieve 3 steps here.
1. Setup Fusion Middleware Control (EM) in your domain
In short your domain will need to be setup as per these steps.
http://theblasfrompas.blogspot.com/2009/07/installing-adf-runtime-on-oracle-fusion.html
2. Deploy an ADF BC App Module as a Web Service Interface
Note: It is assumed you have a client method exposed in your ADF BC application module. An example of such a method is as follows. You will need to ensure the method is exposed as a client method.
2.1. Right click on your application module XML file and and select "Open {app module name}"
2.2. Select "Service Interface"
2.3. Select the + symbol
2.4. Enter in the service interface details.
2.5. Click next
2.6. Shuttle across the methods you wish to expose.
2.7. Ignore the "Service View Instances" and click next
2.8 Click Finish.
You end up with something as follows in the application navigator.

2.9. Now we need to create a deployment profile which we do by double clicking on the proejct to invoke the "Project properties" dialog.
2.10. Select "deployment"
2.11. Click New
2.12. Select the archive type as "Business Components service Interface"
2.13. Give it a name and press Ok
At this point you have created an EJB JAR file , which you can deploy by using the menu item for the workspace "Deploy" and targeting an Application Server Connection for your OFM 11g R1 server. Once deployed you should end up with output as follows.
[10:38:37 AM] ---- Deployment started. ----
[10:38:37 AM] Target platform is (Weblogic 10.3).
[10:38:44 AM] Entering Target Selection Dialog
[10:38:48 AM] Retrieving existing application information
[10:38:48 AM] Running dependency analysis...
[10:38:48 AM] Building...
[10:38:49 AM] Deploying 3 profiles...
[10:38:49 AM] Wrote EJB Module to D:\jdev11gr1\jdeveloper\jdev\mywork\ADFBC-WS\Demo\deploy\ADFBC-WS-Demo-context-root.jar
[10:38:50 AM] Wrote Archive Module to D:\jdev11gr1\jdeveloper\jdev\mywork\ADFBC-WS\Demo\deploy\adfbc-ws_Common.jar
[10:38:50 AM] Wrote Enterprise Application Module to D:\jdev11gr1\jdeveloper\jdev\mywork\ADFBC-WS\deploy\Demo_adfbc-ws.ear
[10:38:52 AM] INFO: Unable to load annotation weblogic.javaee.CallByReferencefor parsing. The annotation is ignored.
[10:38:52 AM] INFO: Unable to load annotation weblogic.javaee.CallByReferencefor parsing. The annotation is ignored.
[10:38:52 AM] INFO: GenericWSWarAnnotationListener.parseAnnotatedClass Adding Servlet Mapping with URL pattern /AppModuleService for annotated WebService class pas.au.adf.ws.server.serviceinterface.AppModuleServiceImpl
[10:38:54 AM] Deploying Application...
[10:38:59 AM] [Deployer:149191]Operation 'deploy' on application 'Demo_adfbc-ws' is initializing on 'debug_ws'
[10:39:16 AM] [Deployer:149192]Operation 'deploy' on application 'Demo_adfbc-ws' is in progress on 'debug_ws'
[10:39:21 AM] [Deployer:149194]Operation 'deploy' on application 'Demo_adfbc-ws' has succeeded on 'debug_ws'
[10:39:21 AM] Application Deployed Successfully.
[10:39:21 AM] Elapsed time for deployment: 43 seconds
[10:39:21 AM] ---- Deployment finished. ----
3. Use FMC (EM) to trace the ADF BC web service execution.
3.1 Log into FMC (EM) as follows
http://{server}:{port}/em
3.2 In the navigator pane, expand WebLogic Domain
3.3. Expand the domain
3.4. Select the desired server from the list.
3.5. From the WebLogic Sever menu, select Logs > Log Configuration
3.6. On the "Log Levels" tab you need to select "Loggers with persistent Log Level State", then expand the "Specify Loggers"
3.7. At the bottom and enter the logger name "oracle.webservices" and optionally setup the " Diagnostic Logging Level" you wish to use.
3.8. Press Apply.
Now at this point we have to restart the server.
Once re-started log back into EM and verify the Log configuration shows "oracle.webservices" as shown below.

Now we can test our web services as shown in this entry and verify we get web services diagnostics logging placed into the log file "debug_ws-diagnostic.log" which would be in a directory as follows $DOMAIN_HOME/servers/{managed-server-name}/logs
http://theblasfrompas.blogspot.com/2009/09/web-services-security-in-ofm-11g-r1.html
An example of the output is as follows
You can also view the log file from FMC (EM) as follows:
- From the WebLogic Sever menu, select Logs > View Log Messages
- Click on "Target Log Files" button.
- In the log files table select the row containing "debug_ws-diagnostic.log" and press the button "View Log File".
More Information
Oracle® Fusion Middleware Security and Administrator's Guide for Web Services
11g Release 1 (11.1.1)
Part Number B32511-01
15 Diagnosing Problems
http://download.oracle.com/docs/cd/E12839_01/web.1111/b32511/diagnosing.htm#WSSEC1226http://feeds.feedburner.com/TheBlasFromPas
Note: This is only applicable to ADF BC Web Services, the same steps won't work for JAX-WS or PLSQL web services created in JDeveloper 11g R1.
The documentation for Service-Enabled application modules can be found here.
Oracle® Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework
11g Release 1 (11.1.1)
Part Number B31974-03
11 Integrating Service-Enabled Application Modules
http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcextservices.htm#CJAJGIEB
In order to do this we need to achieve 3 steps here.
1. Setup Fusion Middleware Control (EM) in your domain
In short your domain will need to be setup as per these steps.
http://theblasfrompas.blogspot.com/2009/07/installing-adf-runtime-on-oracle-fusion.html
2. Deploy an ADF BC App Module as a Web Service Interface
Note: It is assumed you have a client method exposed in your ADF BC application module. An example of such a method is as follows. You will need to ensure the method is exposed as a client method.
public String getVersion ()
{
return getSession().getVersion();
}
2.1. Right click on your application module XML file and and select "Open {app module name}"
2.2. Select "Service Interface"
2.3. Select the + symbol
2.4. Enter in the service interface details.
2.5. Click next
2.6. Shuttle across the methods you wish to expose.
2.7. Ignore the "Service View Instances" and click next
2.8 Click Finish.
You end up with something as follows in the application navigator.

2.9. Now we need to create a deployment profile which we do by double clicking on the proejct to invoke the "Project properties" dialog.
2.10. Select "deployment"
2.11. Click New
2.12. Select the archive type as "Business Components service Interface"
2.13. Give it a name and press Ok
At this point you have created an EJB JAR file , which you can deploy by using the menu item for the workspace "Deploy" and targeting an Application Server Connection for your OFM 11g R1 server. Once deployed you should end up with output as follows.
[10:38:37 AM] ---- Deployment started. ----
[10:38:37 AM] Target platform is (Weblogic 10.3).
[10:38:44 AM] Entering Target Selection Dialog
[10:38:48 AM] Retrieving existing application information
[10:38:48 AM] Running dependency analysis...
[10:38:48 AM] Building...
[10:38:49 AM] Deploying 3 profiles...
[10:38:49 AM] Wrote EJB Module to D:\jdev11gr1\jdeveloper\jdev\mywork\ADFBC-WS\Demo\deploy\ADFBC-WS-Demo-context-root.jar
[10:38:50 AM] Wrote Archive Module to D:\jdev11gr1\jdeveloper\jdev\mywork\ADFBC-WS\Demo\deploy\adfbc-ws_Common.jar
[10:38:50 AM] Wrote Enterprise Application Module to D:\jdev11gr1\jdeveloper\jdev\mywork\ADFBC-WS\deploy\Demo_adfbc-ws.ear
[10:38:52 AM] INFO: Unable to load annotation weblogic.javaee.CallByReferencefor parsing. The annotation is ignored.
[10:38:52 AM] INFO: Unable to load annotation weblogic.javaee.CallByReferencefor parsing. The annotation is ignored.
[10:38:52 AM] INFO: GenericWSWarAnnotationListener.parseAnnotatedClass Adding Servlet Mapping with URL pattern /AppModuleService for annotated WebService class pas.au.adf.ws.server.serviceinterface.AppModuleServiceImpl
[10:38:54 AM] Deploying Application...
[10:38:59 AM] [Deployer:149191]Operation 'deploy' on application 'Demo_adfbc-ws' is initializing on 'debug_ws'
[10:39:16 AM] [Deployer:149192]Operation 'deploy' on application 'Demo_adfbc-ws' is in progress on 'debug_ws'
[10:39:21 AM] [Deployer:149194]Operation 'deploy' on application 'Demo_adfbc-ws' has succeeded on 'debug_ws'
[10:39:21 AM] Application Deployed Successfully.
[10:39:21 AM] Elapsed time for deployment: 43 seconds
[10:39:21 AM] ---- Deployment finished. ----
3. Use FMC (EM) to trace the ADF BC web service execution.
3.1 Log into FMC (EM) as follows
http://{server}:{port}/em
3.2 In the navigator pane, expand WebLogic Domain
3.3. Expand the domain
3.4. Select the desired server from the list.
3.5. From the WebLogic Sever menu, select Logs > Log Configuration
3.6. On the "Log Levels" tab you need to select "Loggers with persistent Log Level State", then expand the "Specify Loggers"
3.7. At the bottom and enter the logger name "oracle.webservices" and optionally setup the " Diagnostic Logging Level" you wish to use.
3.8. Press Apply.
Now at this point we have to restart the server.
Once re-started log back into EM and verify the Log configuration shows "oracle.webservices" as shown below.

Now we can test our web services as shown in this entry and verify we get web services diagnostics logging placed into the log file "debug_ws-diagnostic.log" which would be in a directory as follows $DOMAIN_HOME/servers/{managed-server-name}/logs
http://theblasfrompas.blogspot.com/2009/09/web-services-security-in-ofm-11g-r1.html
An example of the output is as follows
<anonymous>
] [ecid: 0000IFdFy2wFw000jzwkno1Aidcd00003S,0:3] [WEBSERVICE_PORT.name:
AppModuleServiceSoapHttpPort] [APP: Demo_adfbc-ws] [J2EE_MODULE.name:
ADFBC-WS-Demo-context-root] [WEBSERVICE.name: AppModuleService]
[J2EE_APP.name: Demo_adfbc-ws] Incomplete connection information
[2009-09-24T09:32:46.827+10:00] [debug_ws] [WARNING] []
[oracle.adf.share.jndi.ReferenceStoreHelper] [tid: [ACTIVE].ExecuteThread:
'2' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId:
<anonymous>
] [ecid: 0000IFdFy2wFw000jzwkno1Aidcd00003S,0:3] [WEBSERVICE_PORT.name:
AppModuleServiceSoapHttpPort] [APP: Demo_adfbc-ws] [J2EE_MODULE.name:
ADFBC-WS-Demo-context-root] [WEBSERVICE.name: AppModuleService]
[J2EE_APP.name: Demo_adfbc-ws] Incomplete connection reference object
[2009-09-24T09:32:50.828+10:00] [debug_ws] [TRACE] [OWS-04010]
[oracle.webservices.service] [tid: [ACTIVE].ExecuteThread: '2' for queue:
'weblogic.kernel.Default (self-tuning)'] [userId:
<anonymous>
] [ecid: 0000IFdFy2wFw000jzwkno1Aidcd00003S,0:3] [SRC_CLASS:
oracle.j2ee.ws.server.ServerMessages] [APP: Demo_adfbc-ws] [SRC_METHOD:
fineMsgServletResponse] [arg:
{/pas/au/adf/ws/common/}AppModuleServiceSoapHttpPort] [arg:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
<ns0:getVersionResponse xmlns:ns0="/pas/au/adf/ws/common/types/">
<result xmlns="/pas/au/adf/ws/common/types/">11.1.1.54.7</result>
</ns0:getVersionResponse>
</env:Body>
</env:Envelope>
] The SOAP response for port:
{/pas/au/adf/ws/common/}AppModuleServiceSoapHttpPort is:[[
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
<ns0:getVersionResponse xmlns:ns0="/pas/au/adf/ws/common/types/">
<result xmlns="/pas/au/adf/ws/common/types/">11.1.1.54.7</result>
</ns0:getVersionResponse>
</env:Body>
</env:Envelope>
]]
</anonymous>
</anonymous>
</anonymous>
You can also view the log file from FMC (EM) as follows:
- From the WebLogic Sever menu, select Logs > View Log Messages
- Click on "Target Log Files" button.
- In the log files table select the row containing "debug_ws-diagnostic.log" and press the button "View Log File".
More Information
Oracle® Fusion Middleware Security and Administrator's Guide for Web Services
11g Release 1 (11.1.1)
Part Number B32511-01
15 Diagnosing Problems
http://download.oracle.com/docs/cd/E12839_01/web.1111/b32511/diagnosing.htm#WSSEC1226http://feeds.feedburner.com/TheBlasFromPas
Categories: Fusion Middleware
Web Services Security in OFM 11g R1
I ran 2 good blog entries for securing web services from JDeveloper 11g onto WLS 11g R1. Both these are great starting points for that and worked well. Saves a lot of time when it's all laid out step by step.
http://one-size-doesnt-fit-all.blogspot.com/2009/08/one-way-ssl-with-jax-ws-using.html
http://kingsfleet.blogspot.com/2009/01/security-policy-worked-example.html
I always create my WLS domains adding Fusion Middleware Control and that then gives you the ability to test the web service from a browser as well as view some runtime statistics for the web service itself when logging into the "/em" application installed into the admin server.
The blog entry showing how to install Fusion Middleware Control into a WLS 11g R1 domain is as follows. I even started deploying from that application rather then using the traditional console application.
http://theblasfrompas.blogspot.com/2009/07/installing-adf-runtime-on-oracle-fusion.html
So in short
1. Log into em using an url as follows
http://{server}:{adminserverport}/em
2. Click on your web service application
3. If indeed web services exist in the application you will see a web services table and "Java EE Web Services" tab as shown below.

4. Click on the "Test" icon to test your web service.http://feeds.feedburner.com/TheBlasFromPas
http://one-size-doesnt-fit-all.blogspot.com/2009/08/one-way-ssl-with-jax-ws-using.html
http://kingsfleet.blogspot.com/2009/01/security-policy-worked-example.html
I always create my WLS domains adding Fusion Middleware Control and that then gives you the ability to test the web service from a browser as well as view some runtime statistics for the web service itself when logging into the "/em" application installed into the admin server.
The blog entry showing how to install Fusion Middleware Control into a WLS 11g R1 domain is as follows. I even started deploying from that application rather then using the traditional console application.
http://theblasfrompas.blogspot.com/2009/07/installing-adf-runtime-on-oracle-fusion.html
So in short
1. Log into em using an url as follows
http://{server}:{adminserverport}/em
2. Click on your web service application
3. If indeed web services exist in the application you will see a web services table and "Java EE Web Services" tab as shown below.

4. Click on the "Test" icon to test your web service.http://feeds.feedburner.com/TheBlasFromPas
Categories: Fusion Middleware
JDeveloper 11g - PLSQL Web Service Returning a Table of Objects
Got a few emails about problems using a Table of Objects within PLSQL Web Services now it's been reintroduced into JDeveloper 11g. Here is a small demo which worked fine for me.
1. Run the following SQL in the classic SCOTT schema
3. Right click on the Web Service "DemoWS" and select "Run". It may take a while to start but eventually you should see it's started as follows.
5. Click on "Test Page"
6. Click on the only function "testDeptTable"
7. Verify response as follows.
Note: If you wanted to test using the Table as an IN parameter simply create a method as follows in the PLSQL package which would enable you to test this as well.
1. Run the following SQL in the classic SCOTT schema
drop type dept_type;2. Create a PLSQL Web Service called "DemoWS" using the defaults for the package WS_PACKAGE.
drop type dept_list_table;
create type dept_type as object
(deptno NUMBER,
dname VARCHAR2(14),
loc varchar2(13),
cr_date date)
/
create type dept_list_table is table of dept_type
/
purge recyclebin;
create or replace package ws_package as
function test_dept_table return dept_list_table;
end ws_package;
/
show errors;
create or replace package body ws_package as
function test_dept_table return dept_list_table is
all_depts dept_list_table := dept_list_table();
dRecType dept_type;
i number := 0;
begin
-- iterate through all depts
for r_list in (select * from dept) loop
i := i + 1;
dRecType := dept_type(null, null, null, null);
dRecType.deptno := r_list.deptno;
dRecType.dname := r_list.dname;
dRecType.loc := r_list.loc;
dRecType.cr_date := sysdate;
all_depts.extend;
all_depts(i) := dRecType;
end loop;
return all_depts;
end test_dept_table;
end ws_package;
/
show errors;
3. Right click on the Web Service "DemoWS" and select "Run". It may take a while to start but eventually you should see it's started as follows.
Run startup time: 10437 ms.
[Application WebServicesTest deployed to Server Instance DefaultServer]
Target URL -- http://localhost:7101/WebServicesTest-PLSQLTest-context-root/DemoWSPort
09/08/13 09:49:19 Web service DemoWS has been started on the embedded server
4. Copy the URL above into a browser.5. Click on "Test Page"
6. Click on the only function "testDeptTable"
7. Verify response as follows.
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header />
<env:Body>
<m:testDeptTableResponse xmlns:m="http://au/support/ws/DemoWS.wsdl">
<result xmlns:typ="http://au/support/ws/DemoWS.wsdl/types/">
<typ:DeptTypeUser>
<typ:dname>ACCOUNTING</typ:dname>
<typ:loc>NEW YORK</typ:loc>
<typ:deptno>10</typ:deptno>
<typ:crDate>2009-08-13T08:36:53.000+10:00</typ:crDate>
</typ:DeptTypeUser>
<typ:DeptTypeUser>
<typ:dname>RESEARCH</typ:dname>
<typ:loc>DALLAS</typ:loc>
<typ:deptno>20</typ:deptno>
<typ:crDate>2009-08-13T08:36:53.000+10:00</typ:crDate>
</typ:DeptTypeUser>
<typ:DeptTypeUser>
<typ:dname>SALES</typ:dname>
<typ:loc>CHICAGO</typ:loc>
<typ:deptno>30</typ:deptno>
<typ:crDate>2009-08-13T08:36:53.000+10:00</typ:crDate>
</typ:DeptTypeUser>
<typ:DeptTypeUser>
<typ:dname>OPERATIONS</typ:dname>
<typ:loc>BOSTON</typ:loc>
<typ:deptno>40</typ:deptno>
<typ:crDate>2009-08-13T08:36:53.000+10:00</typ:crDate>
</typ:DeptTypeUser>
</result>
</m:testDeptTableResponse>
</env:Body>
</env:Envelope>
Note: If you wanted to test using the Table as an IN parameter simply create a method as follows in the PLSQL package which would enable you to test this as well.
http://feeds.feedburner.com/TheBlasFromPas
function echo_dept_list_table (v1 in dept_list_table) return dept_list_table is
begin
return v1;
end echo_dept_list_table;
Categories: Fusion Middleware


