Friday, August 26, 2011

Native XML (BI) Publisher Report

This post describes how to create a report using XML Publisher in Oracle E-Business Suite.
Traditionally when a XML Publisher report has been created Oracle Reports have been the engine to
produce the XML. A template has then been developed to use the created XML. This way of working
is only recommended when the Oracle Report is already available and a new layout is created. If a
new report is created from scratch you should use the XML Publisher engine to create both the XML
and the layout. It is possible to use this method in both 11.5.10 and R12.

How to create a native XML Publisher report
The query and parameters is created in a XML-document called Data Template.
Example of a Data Template:
<?xml version="1.0" encoding="WINDOWS-1252" ?>
<dataTemplate name="CUST_LIST" description="Orderdetail per customer" version="1.0">
<parameters>
<parameter name="p_fr_datum" datatype="character"/>
<parameter name="p_till_datum" datatype="character"/>
<parameter name="p_ordertyp" datatype="character"/>
<parameter name="p_status" datatype="character"/>
<parameter name="p_kundnr" datatype="number"/>
<parameter name="p_kst" datatype="varchar2"/>
</parameters>
<dataQuery>
<sqlStatement name="Q_param">
  SELECT TO_CHAR(TO_DATE(SUBSTR(:p_fr_datum,1,10),'yyyy/mm/dd'),'yyyy-mm-dd') fr_datum,
         TO_CHAR(TO_DATE(SUBSTR(:p_till_datum,1,10),'yyyy/mm/dd'),'yyyy-mm-dd') ti_datum,
        (SELECT name FROM oe_transaction_types_vl WHERE transaction_type_id = :p_ordertyp) otyp,
        (SELECT meaning FROM oe_lookups WHERE lookup_type = 'FLOW_STATUS' AND lookup_code = :p_status) status,
        (SELECT party.party_name||' ('||cust.account_number||')' kund FROM hz_cust_accounts cust, hz_parties party WHERE cust.party_id = party.party_id AND cust.account_number = :p_kundnr) kund
   FROM dual
</sqlStatement>
<sqlStatement name="Q1">
  SELECT h.customer_number kundnr,
         h.sold_to kundnamn,
         h.ship_to_location leveransid,
         h.order_number ordernummer,
         h2.order_number avtalsnummer,
         l.ordered_item artikel,
         i.description artikelnamn,
         l.ship_to_address1 lev_adress_1,
         l.ship_to_address2 lev_adress_2,
         l.ship_to_address3 lev_adress_3,
         l.ship_to_address4 lev_adress_4,
         l.ship_to_address5 lev_adress_5,
         h.attribute7 kund_ref,
         h.attribute17 fakturaref
  FROM oe_order_headers_v h,
       oe_order_lines_v l,
       mtl_system_items_b i,
       oe_order_headers_all h2
  WHERE h.header_id = l.header_id
  AND   l.inventory_item_id = i.inventory_item_id
  ANd   i.organization_id = 101
  AND   h.ordered_date BETWEEN TO_DATE(SUBSTR(:p_fr_datum,1,10),'yyyy/mm/dd') AND TO_DATE(SUBSTR(:p_till_datum,1,10),'yyyy/mm/dd')
  AND   h.order_type_id = :p_ordertyp
  AND   h.source_document_id = h2.header_id (+)
  AND   h.flow_status_code = nvl(:p_status, h.flow_status_code)
  AND   h.customer_number = nvl(:p_kundnr, h.customer_number)
  AND   h2.attribute1 = nvl(:p_kst, h2.attribute1)
  ORDER BY h.order_number
</sqlStatement>
</dataQuery>
<dataStructure>
<group name="G_PARAM" source="Q_param">
<element name="FR_DATUM" value="FR_DATUM" />
<element name="TI_DATUM" value="TI_DATUM" />
<element name="OTYP" value="OTYP" />
<element name="STATUS" value="STATUS" />
<element name="KUND" value="KUND" />
</group>
<group name="G_CUST" source="Q1">
<element name="KUNDNR" value="KUNDNR" />
<element name="KUNDNAMN" value="KUNDNAMN"/>
<element name="LEVERANSID" value="LEVERANSID" />
<element name="ORDERNUMMER" value="ORDERNUMMER" />
<element name="AVTALSNUMMER" value="AVTALSNUMMER" />
<element name="ARTIKEL" value="ARTIKEL" />
<element name="ARTIKELNAMN" value="ARTIKELNAMN" />
<element name="LEV_ADRESS_1" value="LEV_ADRESS_1" />
<element name="LEV_ADRESS_2" value="LEV_ADRESS_2" />
<element name="LEV_ADRESS_3" value="LEV_ADRESS_3" />
<element name="LEV_ADRESS_4" value="LEV_ADRESS_4" />
<element name="LEV_ADRESS_5" value="LEV_ADRESS_5" />
<element name="KUND_REF" value="KUND_REF" />
<element name="FAKTURAREF" value="FAKTURAREF" />
</group>
</dataStructure>
</dataTemplate>
How to develop a Data Template is described in detail in Oracle XML Publisher Administration and Developers Guide.

The Data Template is uploaded under the Data Definition under the XML Publisher Administrator responsibility.


The next step is to set up the concurrent request so the report can be run with XML output. The XML is needed to develop the template.


Three things are important to set when the request is created:
1. The Short Name must have the same value as the Data Definition Code.
2. The Executable Name must have the value of XDODTEXE.
3. The Output Format must have the value of XML.

Now it is possible to run the concurrent Request and (1) validate that the Data Template is working as expected and (2) verify the produced XML output and use it to develop the template.

When the template is created and uploaded under Templates in the XML Publisher Administrator responsibility it is possible to run the request and see the final result.


One thing is important to set when the Template is created:
1. The Template Code must have the same value as the Data Definition Code.

Sources
• Oracle XML Publisher Administration and Developers Guide
• Oracle XML Publisher Report Designer's Guide

Thursday, August 25, 2011

Get your ORGs...

To list your organizations in EBS run

select * from hr_all_organization_units;
select * from hr_all_organization_units_tl;

Tuesday, August 23, 2011

Set MOAC context (R12)

To set the MOAC (Multiorg Access Control) context in your database session (SQL*PLUS, TOAD, SQL Developer etc) use:
begin
  mo_global.set_policy_context('S', <orgID>);
end;
When policy context is set to M (Multi), data from all accessible Operating Units will be returned. When policy context is set to S (Single), then only data from the specified org_id will be returned.

Set language:
alter session set nls_language = 'SWEDISH';

Monday, August 22, 2011

Clear buffer cache

When you are working with performance issues you need to have an empty database cache to get a "real" result from your query. If you run a query which runs for 2 minutes the first time it would run very much faster the second time. To prevent the database to fetch the result from the cache you need to clear the buffer cache.

Run the command below to flush the cache (you need a DB-user which has sufficient privileges, for example system)
alter system flush buffer_cache;
Note: this should not be done in any production enviroment.

Tuesday, August 16, 2011

Creating a PL/SQL based webservice with a XMLType in/out parameter (EBS 12.1.1)

Out of the box can we not create a webservice that have a parameter (in or out) of type XMLType using SOA Gateway. When the service is called you will get an error.

In-parameter:
Error Description:  Error occured while service was being generated. 
Error Details:  oracle.apps.fnd.soa.util.SOAException: ServiceGenerationError: Exception returned from JCA Service Runtime.

    Missing class: oracle.xdb.XMLType

  Dependent class: oracle.tip.adapter.db.sp.oracle.TypeConverter
           Loader: AppsSOAAdapter:0.0.0
      Code-Source: /u02/oracle/VISION2/apps/tech_st/10.1.3/j2ee/oafm/connectors/AppsSOAAdapter/AppsSOAAdapter/DBAdapter.jar
    Configuration:  in /u02/oracle/VISION2/apps/tech_st/10.1.3/j2ee/oafm/connectors/AppsSOAAdapter/AppsSOAAdapter

The missing class is available from the following locations:

  1. Code-Source: /u02/oracle/VISION2/apps/tech_st/10.1.3/rdbms/jlib/xdb.jar (from  in /u02/oracle/VISION2/apps/apps_st/comn/webapps/oafm/)
     This code-source is available in loader oafm.root:0.0.0. 

  at oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke(JCAHandler.java:222)
  at oracle.apps.fnd.soa.provider.services.jca.JCAHandler.handleRequest(JCAHandler.java:153)
  at oracle.apps.fnd.soa.provider.SOAProvider.processMessage(SOAProvider.java:295)
  at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:956)
  at oracle.j2ee.ws.server.WebServiceProcessor$1.run(WebServiceProcessor.java:358)
  at java.security.AccessController.doPrivileged(Native Method)
  at javax.security.auth.Subject.doAs(Subject.java:396)
  at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:355)
  at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:466)
  at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:114)
  at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:96)
  at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:194)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
  at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
  at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
  at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
  at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
  at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
  at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
  at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
  at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
  at java.lang.Thread.run(Thread.java:619)
oracle.apps.fnd.soa.util.SOAException: ServiceGenerationError: Exception returned from JCA Service Runtime.

    Missing class: oracle.xdb.XMLType

  Dependent class: oracle.tip.adapter.db.sp.oracle.TypeConverter
           Loader: AppsSOAAdapter:0.0.0
      Code-Source: /u02/oracle/VISION2/apps/tech_st/10.1.3/j2ee/oafm/connectors/AppsSOAAdapter/AppsSOAAdapter/DBAdapter.jar
    Configuration:  in /u02/oracle/VISION2/apps/tech_st/10.1.3/j2ee/oafm/connectors/AppsSOAAdapter/AppsSOAAdapter

The missing class is available from the following locations:

  1. Code-Source: /u02/oracle/VISION2/apps/tech_st/10.1.3/rdbms/jlib/xdb.jar (from  in /u02/oracle/VISION2/apps/apps_st/comn/webapps/oafm/)
     This code-source is available in loader oafm.root:0.0.0. 

  at oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke(JCAHandler.java:222)
  at oracle.apps.fnd.soa.provider.services.jca.JCAHandler.handleRequest(JCAHandler.java:153)
  at oracle.apps.fnd.soa.provider.SOAProvider.processMessage(SOAProvider.java:295)
  at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:956)
  at oracle.j2ee.ws.server.WebServiceProcessor$1.run(WebServiceProcessor.java:358)
  at java.security.AccessController.doPrivileged(Native Metho

Out-parameter:
Error Description  Error occured while service was being generated. 
Error Details  oracle.apps.fnd.soa.util.SOAException: ServiceGenerationError: Exception returned from JCA Service Runtime.oracle/classloader/util/AnnotatedNoClassDefFoundError
  at oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke(JCAHandler.java:222)
  at oracle.apps.fnd.soa.provider.services.jca.JCAHandler.handleRequest(JCAHandler.java:153)
  at oracle.apps.fnd.soa.provider.SOAProvider.processMessage(SOAProvider.java:295)
  at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:956)
  at oracle.j2ee.ws.server.WebServiceProcessor$1.run(WebServiceProcessor.java:358)
  at java.security.AccessController.doPrivileged(Native Method)
  at javax.security.auth.Subject.doAs(Subject.java:396)
  at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:355)
  at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:466)
  at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:114)
  at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:96)
  at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:194)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
  at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
  at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
  at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
  at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
  at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
  at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
  at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
  at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
  at java.lang.Thread.run(Thread.java:619)
oracle.apps.fnd.soa.util.SOAException: ServiceGenerationError: Exception returned from JCA Service Runtime.oracle/classloader/util/AnnotatedNoClassDefFoundError
  at oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke(JCAHandler.java:222)
  at oracle.apps.fnd.soa.provider.services.jca.JCAHandler.handleRequest(JCAHandler.java:153)
  at oracle.apps.fnd.soa.provider.SOAProvider.processMessage(SOAProvider.java:295)
  at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:956)
  at oracle.j2ee.ws.server.WebServiceProcessor$1.run(WebServiceProcessor.java:358)
  at java.security.AccessController.doPrivileged(Native Method)
  at javax.security.auth.Subject.doAs(Subject.java:396)
  at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:355)
  at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:466)
  at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:114)
  at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:96)
  at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:194)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
  at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
  at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
  at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
  at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
  at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
  at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
  at oracle.oc4j.network.ServerSo

To fix this we need to include xdb.jar in the oc4j.jar.
  1. Shutdown OC4J ($ADMIN_SCRIPTS_HOME/adopmnctl.sh stopall)
  2. Go to $ORACLE_HOME/j2ee/home (make sure that you are in the 10.1.3 folder, NOT 10.1.2)
  3. Make a backup of file oc4j.jar
  4. Copy file oc4j.jar to a temp folder
  5. Extract jar file
    jar xf oc4j.jar
  6. Edit file META-INF/boot.xml
    - In the shared library section called oracle.xml (<shared-library name="oracle.xml" parent="api" version="10.1.0_2">) look for the line <code-source path="${oracle.home}/rdbms/jlib/xdb.jar"/>
    - If the line is missing, then add the line to the section
    - Double check that xdb.jar exists in $ORACLE_HOME/rdbms/jlib/ (10.1.3 folder)
  7. Re-packaged boot.xml into oc4j.jar with path meta-inf
    jar uf oc4j.jar META-INF/boot.xml
  8. Copy the new oc4j.jar to $ORACLE_HOME/j2ee/home (10.1.3 folder)
  9. Restart OC4J ($ADMIN_SCRIPTS_HOME/adopmnctl.sh startall)

Monday, August 15, 2011

Fix for "Each row in the Query Result Columns..." when extending VO

When you are extending a VO you can quite often run in to the error "Each row in the Query Result Columns must be mapped to a unique query attribute in the Mapped Entity columns". The error is related to the view object you are trying to extend and indicates that there is something wrong with it. If you search for this error on My Oracle Support you will see that the fix is to get a patch that replaces the base VO that the problem is related to.

One potential error is that there are some CASE problems in the base VO declaration. For example, a selected column is named PartyId in the query but under Attributes the name is partyId. Though java is case-sensitive you can run into problems.



If you google this problem you will find a few different potential solutions, but of the ones I have found, the solution below is the most reliable.

  1. Create your extended view object without changing anything.
  2. Open up you newly created VO and click on the tree node "Attributes".
  3. Click the "New..." button and create your new column (a transient attribute will be created).
  4. Save and reopen the VO.
  5. Now change the Query Statement and add the new column in your select (the new column must have the same alias as the column added in step 3).
  6. Save and reopen the VO.
  7. Change the attribute you added in step 3. Make sure you check "Mapped to Column or SQL" and that the rest of the settings are correct.
  8. Done
Note: When I have added the column in the select statement I sometimes get errors in the attribute names (the error can be seen under the "Attributes" tree node).
 - two many attributes
 - the names are corrupted

To fix this error close the VO declaration and go to the file system and open up the <VO>.xml. Edit the file and correct the errors and repoen the VO in jDeveloper. Now everything should run smoothly...

Sunday, August 14, 2011

Fix for java.sql.SQLException: Invalid column type when extending a VO

When you are extending a view object (VO) in OA Framework it's possible that you will run in to the problem java.sql.SQLException: Invalid column type, especially if it's an LOV VO you are trying to extend. When you click on the LOV torch for the first time it is working fine. But whenever you click on the GO button in the LOV Region it gives an error.

The error can look like this:
oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException:
JBO-27122: SQL error during statement preparation.  
Statement: SELECT * FROM (SELECT ca.location LocId,
ca.party_site_number LocNumber,
ca.party_name PartyName,
ca.party_number PartyNumber,
ca.address1 Address1,
ca.address2 Address2,
ca.address3 Address3,
ca.address4 Address4,
ca.city City,
ca.state State,
ca.zip PostalCode,
ca.country Country,
ca.party_id partyId,
hzp.site_use_type CurrSiteUsage
FROM csi_hzpty_addresses_v ca,
hz_party_site_uses hzp,
hz_cust_acct_sites_all hcas,
hz_cust_site_uses_all hcsu
WHERE ca.party_id = :1
AND   ca.location = hzp.party_site_id(+)
AND   site_use_type(+) = 'INSTALL_AT'
AND   ca.status = 'A'
AND   SYSDATE BETWEEN NVL(ca.start_date_active, SYSDATE)
AND NVL(ca.end_date_active, SYSDATE)
AND   hzp.status(+) = 'A'
AND   ca.location = hcas.party_site_id
AND   hcsu.cust_acct_site_id = hcas.cust_acct_site_id
AND   hcsu.status = 'A'
AND   hcsu.site_use_code = 'SHIP_TO'
AND   hcas.org_id = nvl(FND_PROFILE.VALUE('ORG_ID'), hcas.org_id)
AND   hcsu.org_id = nvl(FND_PROFILE.VALUE('ORG_ID'), hcsu.org_id))
QRSLT  WHERE (( UPPER(ADDRESS1) like UPPER(:2) AND
(ADDRESS1 like :3 OR ADDRESS1 like :4 OR ADDRESS1 like :5 OR 
ADDRESS1 like :6)))
at oracle.apps.fnd.framework.OAException.wrapperException
(OAException.java:896)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException
(OAPageErrorHandler.java:1169)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors
(OAPageErrorHandler.java:1435)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest
(OAPageBean.java:2867)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage
(OAPageBean.java:1840)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage
(OAPageBean.java:538)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage
(OAPageBean.java:426)
at _OA._jspService(_OA.java:212)
at com.orionserver.http.OrionHttpJspPage.service
(OrionHttpJspPage.java:59)
at oracle.jsp.runtimev2.JspPageTable.service
(JspPageTable.java:379)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ResourceFilterChain.doFilter
(ResourceFilterChain.java:64)
at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter
(ReleaseResFilter.java:26)
at com.evermind.server.http.EvermindFilterChain.doFilter
(EvermindFilterChain.java:15)
at oracle.apps.fnd.security.AppsServletFilter.doFilter
(AppsServletFilter.java:318)
at com.evermind.server.http.ServletRequestDispatcher.invoke
(ServletRequestDispatcher.java:621)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal
(ServletRequestDispatcher.java:370)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest
(HttpRequestHandler.java:871)
at com.evermind.server.http.HttpRequestHandler.processRequest
(HttpRequestHandler.java:453)
at com.evermind.server.http.AJPRequestHandler.run
(AJPRequestHandler.java:313)
at com.evermind.server.http.AJPRequestHandler.run
(AJPRequestHandler.java:199)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run
(ServerSocketReadHandler.java:260)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run
(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:619)
## Detail 0 ##
java.sql.SQLException: Invalid column type
at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical
(OraclePreparedStatement.java:8516)
at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal
(OraclePreparedStatement.java:8034)
at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal
(OraclePreparedStatement.java:8767)
at oracle.jdbc.driver.OraclePreparedStatement.setObject
(OraclePreparedStatement.java:8748)...

What you need to change is the Binding Style from Oracle Named to Oracle Positional in the View Object declaration. The framework is adding a where clause to the query using bind variables that are typed :n, this is why you need to set Oracle Positional.

Query entered in the VO:
SELECT ca.location LocId,
ca.party_site_number LocNumber,
ca.party_name PartyName,
ca.party_number PartyNumber,
ca.address1 Address1,
ca.address2 Address2,
ca.address3 Address3,
ca.address4 Address4,
ca.city City,
ca.state State,
ca.zip PostalCode,
ca.country||' (Funktionsnr: '||to_char(hcsu.site_use_id)||')' Country,
ca.party_id PartyId,
hzp.site_use_type CurrSiteUsage
FROM csi_hzpty_addresses_v ca,
hz_party_site_uses hzp,
hz_cust_acct_sites_all hcas,
hz_cust_site_uses_all hcsu
WHERE ca.party_id = :1
AND   ca.location = hzp.party_site_id(+)
AND   site_use_type(+) = 'INSTALL_AT'
AND   ca.status = 'A'
AND   SYSDATE BETWEEN NVL(ca.start_date_active, SYSDATE) AND NVL(ca.end_date_active, SYSDATE)
AND   hzp.status(+) = 'A'
AND   ca.location = hcas.party_site_id
AND   hcsu.cust_acct_site_id = hcas.cust_acct_site_id
AND   hcsu.status = 'A'
AND   hcsu.site_use_code = 'SHIP_TO'
AND   hcas.org_id = nvl(FND_PROFILE.VALUE('ORG_ID'), hcas.org_id)
AND   hcsu.org_id = nvl(FND_PROFILE.VALUE('ORG_ID'), hcsu.org_id)

Query when click the Go button in the LOV region:
SELECT * FROM (SELECT ca.location LocId,
ca.party_site_number LocNumber,
ca.party_name PartyName,
ca.party_number PartyNumber,
ca.address1 Address1,
ca.address2 Address2,
ca.address3 Address3,
ca.address4 Address4,
ca.city City,
ca.state State,
ca.zip PostalCode,
ca.country Country,
ca.party_id partyId,
hzp.site_use_type CurrSiteUsage
FROM csi_hzpty_addresses_v ca,
hz_party_site_uses hzp,
hz_cust_acct_sites_all hcas,
hz_cust_site_uses_all hcsu
WHERE ca.party_id = :1
AND   ca.location = hzp.party_site_id(+)
AND   site_use_type(+) = 'INSTALL_AT'
AND   ca.status = 'A'
AND   SYSDATE BETWEEN NVL(ca.start_date_active, SYSDATE)
AND NVL(ca.end_date_active, SYSDATE)
AND   hzp.status(+) = 'A'
AND   ca.location = hcas.party_site_id
AND   hcsu.cust_acct_site_id = hcas.cust_acct_site_id
AND   hcsu.status = 'A'
AND   hcsu.site_use_code = 'SHIP_TO'
AND   hcas.org_id = nvl(FND_PROFILE.VALUE('ORG_ID'), hcas.org_id)
AND   hcsu.org_id = nvl(FND_PROFILE.VALUE('ORG_ID'), hcsu.org_id)) QRSLT
WHERE (( UPPER(ADDRESS1) like UPPER(:2) AND (ADDRESS1 like :3 OR ADDRESS1  
like  :4 OR ADDRESS1 like :5 OR ADDRESS1 like :6)))
Change Binding Style

Increase timeout settings for Apache in EBS R12

You may need to increase the timeout setting for the Apache server if you have long running webservices. Our test server was extremly slow so we needed to update this number. The below instructions will cahnge the timeout value from 300 seconds to 900.

  1. Open $ORA_CONFIG_HOME/10.1.3/Apache/Apache/conf/httpd.conf

  2. Look for the value Timeout

  3. Change Timeout 300 to Timeout 900

  4. Restart opmn
    $ADMIN_SCRIPTS_HOME/adopmnctl.sh stopall
    $ADMIN_SCRIPTS_HOME/adopmnctl.sh startall

Increase java heap space for SOA Gateway

One problem you can face when you are working with a webservice that returns thousands of rows is that you will get memory problems. In the webservice SOAP response you will see something like SERVICE ERROR.

When you go into eBusiness Suite and look in the SOA Monitor you will see a java exception:
Error description SYSTEM_ERROR
Error details java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOfRange(Arrays.java:3209)
at java.lang.String.<init>(String.java:216)
at java.lang.StringBuilder.toString(StringBuilder.java:430)....

To fix this problem we need to increase the java heap space for the JVM oafm (the default value is 256MB). The below instructions will set it to 1GB.
  1. Open $ORA_CONFIG_HOME/10.1.3/opmn/conf/opmn.xml
  2. Find the row  that starts with <process-type id="oafm" module-id="OC4J" status="enabl...
  3. Under start-parameters change:
    - <data id="java-options" value="-server -verbose:gc -Xmx256M... to <data id="java-options" value="-server -verbose:gc -Xmx1024M...
  4. Under stop-parameters change:
    - <data id="java-options" value="-server -verbose:gc -Xmx256M... to <data id="java-options" value="-server -verbose:gc -Xmx1024M...
  5. Restart the opmn
    $ADMIN_SCRIPTS_HOME/adopmnctl.sh stopall
    $ADMIN_SCRIPTS_HOME/adopmnctl.sh startall

Sources

How to create a custom integration interface in SOA Gateway

This example will illustrate on how to develop a simple interface using PL/SQL. The Integration Repository will recognize integrations through annotations in the code (details about annotations can be found in the Integrated SOA Gateway Developer's Guide, Appendix A).
  • You can annotate *.pls and *.pkh files.
  • For PL/SQL packages, only the package spec should be annotated. Do not annotate the body.
Example of a annotated package spec:
CREATE OR REPLACE PACKAGE xx_test_soagway AS
/* $Header: $ */
/*#
* This package returns different data from Financials (GL).
* @rep:scope public
* @rep:product gl
* @rep:displayname xx_test_soagway
* @rep:lifecycle active
* @rep:compatibility S
* @rep:category BUSINESS_ENTITY GL_ACCOUNT_COMBINATION
*/

/*#
* Returns CCID
* @param P_SEGMENT1 varchar2 Segment 1
* @param P_SEGMENT2 varchar2 Segment 2
* @param P_SEGMENT3 varchar2 Segment 3
* @param P_SEGMENT4 varchar2 Segment 4
* @param P_SEGMENT5 varchar2 Segment 5
* @return CCID
* @rep:scope public
* @rep:lifecycle active
* @rep:displayname Return CCID
*/
FUNCTION get_ccid (P_SEGMENT1 IN VARCHAR2,
                   P_SEGMENT2 IN VARCHAR2,
                   P_SEGMENT3 IN VARCHAR2,
                   P_SEGMENT4 IN VARCHAR2,
                   P_SEGMENT5 IN VARCHAR2) RETURN NUMBER;

END xx_test_soagway;

Note: The annotation BUSINESS_ENTITY is where in the Integration Repository your custom integration will be found. The below queries will help you find the correct BUSINESS_ENTITY. It's not possible to add your own BUSINESS_ENTITYs in the current version.
  • SELECT * FROM fnd_lookup_assignments WHERE lookup_type = 'BUSINESS_ENTITY'
  • SELECT * FROM fnd_lookups WHERE lookup_type = 'BUSINESS_ENTITY'
In the example above a package called xx_test_soagway is created with one function called get_ccid. The function will return a code combination id for the segment parameters that we are using in the request. The package body is saved on the local hard drive as xx_test_soagway.pls.

The next step is to create an iLDT file (Integration Repository loader file) that we should use to upload to the Integration Repository. The file is created with a tool called Integration Repository Parser (IREP Parser), the tool will validate the file against the annotation standards. Before the iLDT file can be created xx_test_soagway.pls need to be transferred to the server (as applmgr). In this case we will put the file in $GL_TOP/patch/115/sql and /tmp.

Run the command to generate the iLDT file:
$IAS_ORACLE_HOME/perl/bin/perl $FND_TOP/bin/irep_parser.pl -g -v -username=sysadmin gl:patch/115/sql:xx_test_soagway.pls:12.0=/tmp/xx_test_soagway.pls

Note: If you are generating a new iLDT file for an already uploaded interface you need to add a higher version number then the last uploaded.
$IAS_ORACLE_HOME/perl/bin/perl $FND_TOP/bin/irep_parser.pl -g -v -username=sysadmin gl:patch/115/sql:xx_test_soagway.pls:12.1=/tmp/xx_test_soagway.pls

When the iLDT file is successfully created we can upload it to the Integration Repository using:
$FND_TOP/bin/FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/wfirep.lct xx_test_soagway_pls.ildt


 Successfully uploaded to the Integration Repository

Now the package needs to be created in the database

CREATE OR REPLACE PACKAGE xx_test_soagway AS
/* $Header: $ */
/*#
* This package returns different data from Financials (GL).
* @rep:scope public
* @rep:product gl
* @rep:displayname xx_test_soagway
* @rep:lifecycle active
* @rep:compatibility S
* @rep:category BUSINESS_ENTITY GL_ACCOUNT_COMBINATION
*/

/*#
* Returns CCID
* @param P_SEGMENT1 varchar2 Segment 1
* @param P_SEGMENT2 varchar2 Segment 2
* @param P_SEGMENT3 varchar2 Segment 3
* @param P_SEGMENT4 varchar2 Segment 4
* @param P_SEGMENT5 varchar2 Segment 5
* @return CCID
* @rep:scope public
* @rep:lifecycle active
* @rep:displayname Return CCID
*/
FUNCTION get_ccid (P_SEGMENT1 IN VARCHAR2,
                   P_SEGMENT2 IN VARCHAR2,
                   P_SEGMENT3 IN VARCHAR2,
                   P_SEGMENT4 IN VARCHAR2,
                   P_SEGMENT5 IN VARCHAR2) RETURN NUMBER;

END xx_test_soagway;

create or replace
PACKAGE BODY xx_test_soagway AS

  FUNCTION get_ccid (P_SEGMENT1 IN VARCHAR2,
                     P_SEGMENT2 IN VARCHAR2,
                     P_SEGMENT3 IN VARCHAR2,
                     P_SEGMENT4 IN VARCHAR2,
                     P_SEGMENT5 IN VARCHAR2) RETURN NUMBER AS

  v_ccid    NUMBER;

  BEGIN

    SELECT code_combination_id INTO v_ccid
    FROM gl_code_combinations
    WHERE NVL(segment1, ' ') = NVL(P_SEGMENT1, ' ')
    AND   NVL(segment2, ' ') = NVL(P_SEGMENT2, ' ')
    AND   NVL(segment3, ' ') = NVL(P_SEGMENT3, ' ')
    AND   NVL(segment4, ' ') = NVL(P_SEGMENT4, ' ')
    AND   NVL(segment5, ' ') = NVL(P_SEGMENT5, ' ')
    AND   enabled_flag = 'Y';

    RETURN v_ccid;

  EXCEPTION
    WHEN no_data_found THEN
      RETURN -99;
    WHEN too_many_rows THEN
      RETURN -90;
  END get_ccid;
END xx_test_soagway;

When the code have been successfully compiled we need to service enable the new integration interface. Go back to the xx_test_soagway PL/SQL interface and click on the button Generate WSDL.


After the generation of the WSDL a link will appear in the interface page. The next step is to deploy the web service and is simply done by clicking the Deploy button.


When the web service is deployed it is possible to Redploy and Undeploy the service.


The last thing before we can invoke the web service is to set the Grant, this is done by clicking the Create Grant button.

In this example set the Grantee Type to All users.

Before the web service can be invoked we need to restart the Application server and clear the cache.

Restart
cd $INST_TOP/admin/scripts
adoafmctl.sh stop
adoacorectl.sh stop

adoafmctl.sh start
adoacorectl.sh start

Clear cache
Use responsibility Functional Administrator and go to Core Services -> Caching Framework -> Global Configuration -> Clear all cache.


Now the web service is deployed and ready to be invoked.

By using the tool soapUI it is easy to unit test the newly created service (download from www.soapui.org).
Open soapUI and create a new project.


Paste the WSDL link from the E-Business Suite Integration Repository and select some options in the SOAP UI new project dialog.


Add username and password (enduser in E-Business Suite, encrypted password not supported at the moment) and add parameters for segment 1-5. Then click the submit request (top left corner in Request 1 window) to invoke the web service. The response will be shown in the right side of the window.


Sources

Getting started with Integrated SOA Gateway

The Integrated SOA Gateway is a product released with Oracle E-Business Suite version 12. SOA Gateway is built on top of Oracle Fusion Middleware and service-oriented architecture (SOA) technology. This infrastructure not only allows greater and effective business integration between heterogeneous applications, but also facilitates the development and execution of complex business processes into highly flexible and reusable Web services. With this standardized and interoperable Web service platform, Oracle E-Business Suite Integrated SOA Gateway provides a powerful framework that accelerates dynamic business processes and service integration between applications over the Web.

An integration developer can perform end-to-end service integration activities including creating and annotating custom integration interfaces, orchestrating discrete Web services into meaningful end-to-end business processes, defining Web service invocation metadata, and testing the Web service invocation.

Application users can then browse through and search on available integration interfaces and services, regardless of custom or Oracle packaged ones, as well as view each interface details through the centralized repository.

Major Features
  • Provide robust, consistent integration framework with extensive infrastructure based on SOA principles
  • Integrate loosely coupled and heterogeneous applications
  • Contain pre-built and reusable business services
  • Provide native service enablement capability within the Oracle E-Business Suite
  • Use native services as building blocks to create composite services
  • Support annotated custom integration interfaces from Oracle Integration Repository
  • Enforce function security and role-based access control security to allow only authorized users to execute administrative functions
  • Enable Web service invocation from Oracle E-Business Suite
  • Audit and monitor Oracle E-Business Suite service operations from native SOA Monitor

Installation
The Integrated SOA Gateway is not installed out-of-the box when you install eBusiness Suite (12.1.1). There are som patches that needs to be applied and some setup actions that needs to be performed.

  • Installing Oracle E-Business Suite Integrated SOA Gateway, Release 12 [ID 556540.1]
  • Oracle E-Business Suite Integrated SOA Gateway 12.1.1 Integration Repository Parser One-Off [ID 946192.1]
  • Integrated SOA Gateway (ISG) ebservice Invocation Fails With Error "User Not Authorized To Execute The Service" [ID 1269178.1]
  • Integrated SOA Gateway Implementation Guide, section Setting Up Oracle E-Business Suite Integrated SOA Gateway (Chapter 2)
  • Integrated SOA Gateway Implementation Guide, section Setting Up and Using the Integration Repository Parser (Chapter 5, page 3)
Integrated SOA Gateway within Oracle E-Business Suite
A new responsibility to handle SOA Gateway is available in E-Business Suite release 12.


The new responsibility has two functions, Integration Repository and SOA Monitor

Integration Repository
Oracle E-Business Suite Integrated SOA Gateway is the key part of Oracle E-Business Suite for service enablement. It provides the capability of invoking services or Web services and allowing services or Web service clients to make use of the services provided from the Suite.


The Integration Repository is the centralized location where all service related business interfaces are stored. It contains numerous interface endpoints exposed by applications throughout the entire Oracle E-Business Suite and is an essential component within Oracle E-Business Suite Integrated SOA Gateway. This centralized repository not only provides a complete catalog of Oracle E-Business Suite's business interfaces, but also provides a comprehensive, consistent browsing view of the interface mechanism. You can use this tool to easily discover and search on business interfaces, regardless of custom or Oracle packaged ones, from the catalog for integration with any system, application, or business partner.

Note: Oracle Integration Repository supports the following integration interface types which can be categorized as follows:
  • Service enabled
    • PL/SQL
    • XML Gateway Map (inbound)
    • Concurrent Program
    • Business Service Object (Service Beans)
  • Subscription model
    • Business Event
    • XML Gateway Map (outbound)
  • Composite services – BPEL
  • Non-service enabled public interfaces
    • Open Interface Tables
    • Open Interface Views
    • EDI Interface
Major Features
  • A unified repository from which all integration interface types are exposed.
  • Updates are automated and documented.
  • Catalog is searchable on keywords and navigable by product family.
  • A powerful user interface to help you find the data you are looking for from the repository.
  • It supports composite services containing a collection of native interfaces.
  • It enforces security rules to allow only authorized users to perform administrative tasks such as generate and deploy Web services.
SOA Monitor
SOA Monitor is an audit and managing tool that allows all SOAP request and response messages received by SOA Provider and Web Service Provider to be logged and displayed (if the SOA Monitor feature is enabled by setting the profile value “SOA: Service Monitor”).

With SOA Monitor, the Integration Repository Administrator can effectively manage and identify errors incurred during the service deployment life cycle and take necessary actions to expedite the interaction between services.

By clicking the Request and Response icons it is possible to view the details about a specific web service call. The Status column indicates if the invocations were successful or not.

Example of a web service request

Result when clicking the View link on the SOAP Request

Example of a web service response

Result when clicking the View link on the SOAP Response

More reading
  • Integrated SOA Gateway Implementation Guide (February 2010)
  • Integrated SOA Gateway User's Guide (February 2010)
  • Integrated SOA Gateway Developer's Guide (February 2010)
javascript:void(0)