Friday, October 23, 2015

Query DB from BPEL without DB Adapter


Using "orcl:query-database" in BPEL Transformation or Assign

In this blog, I am going to show the way to tackle dynamic 'where' condition in the functionorcl:query-database. It returns a node-set by executing the SQL query against the specified database.

Just a brief introduction about how this function works:-
Signature:
orcl:query-database(sqlquery as string, rowset as boolean, row as boolean, datasource as string)

Arguments:
sqlquery – The SQL query to perform.
rowset – Indicates if the rows should be enclosed in a <rowset> element.
row – Indicates if each row should be enclosed in a <row> element.
datasource – Either a JDBC connect string (jdbc:oracle:thin:username/password@host:port:sid) or a JNDI name for the database.

Example1:
orcl:query-database("select empno from emp
where empno='50'",false(),false(),"jdbc/DbConnection")


Now coming back to the main agenda about giving dynamic value to the where clause. Its pretty simple. Just a little bit trick.

Use the function with the concat function, as:

Example2:
orcl:query-database(concat("select empno from emp where empno=",/tns:Root-Element/tns:Data/:tns:Empno),false(),false(),"jdbc/DbConnection")

Wednesday, October 14, 2015

Error(12,61): Parse of component type files failed, check the adf-config.xml file : “Error at line 110 char 38: Malformed WS Binding port. Missing # between namespace URI and service/port names.”

Error(12,61): Parse of component type files failed, check the adf-config.xml file : “Error at line 110 char 38: Malformed WS Binding port.  Missing # between namespace URI and service/port names.”

Issue: In general this kind of issue occurs, when referring external WSDL or calling any other service (reference).
Solution: Open project composite.xml and search for key word ‘reference’ , missing binding port and location reference looks like

<reference name=”SOA_ErrorHandler”
ui:wsdlLocation=”http://localhost:8001/soa-infra/services/default/SOA_ErrorHandler/Receive.wsdl“>
<interface.wsdl interface=”http://oracle.com/SOA_ErrorHandler#wsdl.interface(Receive_ppt)”/>
<binding.ws port=”” location=””/>
</reference>

Replace the empty tags with listed reference tag (Make necessary changes)

<reference name=”SOA_ErrorHandler”
ui:wsdlLocation=”http://localhost:8001/soa-infra/services/default/SOA_ErrorHandler/Receive.wsdl“>
<interface.wsdl interface=”http://oracle.com/SOA_ErrorHandler#wsdl.interface(Receive_ppt)”/>
<binding.ws port=”http://oracle.com/SOA_ErrorHandler#wsdl.endpoint(Receive/Receive_ppt_pt)”
location=”http://localhost:8001/soa-infra/services/default/SOA_ErrorHandler/Receive?WSDL”/>

</reference>

OR

Create new service reference by deleting the old one.