Wednesday, May 31, 2017

How to Pass BPEL Variable(String Variable) into XSLT in SOA

In BPEL:


<from expression="ora:doXSLTransformForDoc('xsl/Xform_ResourceEBM_to_ResourceRequestABM.xsl', $ResourceReqMsg.ResourceEBM,'counter',$PCounter)"/>

In XSLT:

   <xsl:param name="counter"/>
   <xsl:template match="/">---> Add the parameter just above the template 

How to execute SQL Query in Xquery / Assign Activities in OSB

You can execute SQL Statements without creating the JCA adapter/Business service in OSB. For a simple queries, you can use use

<details>{fn-bea:execute-sql('jdbc/XYZDataSource',xs:QName('FileDetails'),'select Filename,Filelocation from TABLENAME where Columnname=?')} </details>


Output will be something like,

<details>
<FileDetails>
<Filename>ABC</Filename>
<Filelocation>XYZ</Filelocation>
</FileDetails>
</details>

Error while invoking OSM Webservice from BPEL - javax.xml.soap.SOAPException: Bad response: 401 Unauthorized

While Invoking OSM webservice from BPEL, we might get below error if we are not sending the username and password.

successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 401 Unauthorized

we can resolve this error by adding the username,password and security policy to the reference adapter. While we are creating the reference adapter with OSM webservice, by default there will be 2 bindings(OrderManagementWebServiceJMSPort and OrderManagementWebServicePort). But we can ignore the OrderManagementWebServiceJMSPort  and add the policy reference only to OrderManagementWebServicePort as shown below in composite.xml.


<reference name="OrderManagementWS"
               ui:wsdlLocation="oramds:/{MDSURL}/OrderManagementWS.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/communications/ordermanagement#wsdl.interface(OrderManagementWSPort)"/>
<binding.ws port="http://xmlns.oracle.com/communications/ordermanagement#wsdl.endpoint(OrderManagementService/OrderManagementWebServicePort)"
                    location="{OSMURL}"
                    soapVersion="1.1">
<wsp:PolicyReference URI="oracle/wss_username_token_client_policy"
                                 orawsp:category="security"
                                 orawsp:status="enabled">
</wsp:PolicyReference>

<property name="javax.xml.ws.security.auth.password"
                      type="xs:string" many="false" override="may">osmpassword123</property>
<property name="javax.xml.ws.security.auth.username"
                      type="xs:string" many="false" override="may">osm-username</property>
<property name="weblogic.wsee.wsat.transaction.flowOption"
                      type="xs:string" many="false">WSDLDriven</property>
<property name="weblogic.wsee.wsat.transaction.version"
                      type="xs:string" many="false">DEFAULT</property>
</binding.ws>

</reference>

Friday, May 26, 2017

Retry in fault policy is not working - BPEL

Recently faced a issue where the retry in fault policy was not working for few composites. I verified the fault polices in both composites and all look same.
<Action id="ora-retry">
<retry>
<retryCount>3</retryCount>
<retryInterval>10</retryInterval>
<retryFailureAction ref="ora-rethrow-fault"/>
<exponentialBackoff/>
</retry>
</Action>

Then i realized something to do with Composite.xml. Adding the below property in component is making it work.

 <component name="ABC">
        <implementation.bpel src="ABC.bpel"/>
        <property name="bpel.config.transaction">requiresNew</property>
        <property name="bpel.config.oneWayDeliveryPolicy">sync</property>
    </component>

Note: While creating the Synchronous bpel composite's by default it will be"Required".