Wednesday, June 17, 2020

12c OSB - Alert vs Log vs Report

We have 3 out-of-box options for reporting in OSB, below are the differences between them. We can choose one of them based on our requirement.

Log:
  • One of the basics way of logging in the Oracle Service Bus is adding Log Action in every corner of your proxy service.
  • When really debugging a service it’s usually a matter of “what goes in” and “what goes out” and where did my transformation go wrong. So instead of flooding your services with Log Actions, OSB gives an alternate option of enabling Execution tracing(You can find it on each service on the Operational Settings tab, called execution and message tracing).
  • Once we enable the Execution Tracing, the log file will show the full content of MessageContextImpl in every step (stage, route, etc) of the service. The MessageContextImpl holds are the variables like $body, $operation, $inbound and $header you need. – Only Problem in this option is we will end up in logging everything in the server. – Extremely easy to configure but little difficult to track the message in server logs.- Performance impact will be there since all the data is written into one single log file.
Please visit this for the logging implementation steps 12c-osb-enabling-logging.

Alert:
  • An alert action in a pipeline is configured to raise alerts when such predefined conditions are encountered.
  • You can also configure email and JMS alert destinations to receive a notification of the alert, and send the details to the alert recipient in the form of payload.
  • Pipeline alerting can also be used to detect errors in a message flow.
Please visit this for alert implementation steps osb-pipeline-alerts.
Report:
  • Reports mainly used for Track/Monitor the inbound and outbound messages in the proxy services.
  • We can add a Report action in our Request-Response pipeline of our service.
  • The expression field holds the part we actually want to trace – Usually the $Body or Specific Content of the Body element.
  • The Key Name is best used for your reference and let you easily search later on. Which is identical throughout all service calls in the business process. – Correlation Id or Specific element from the body which we can use for tracking during production.
Click here to know steps for Message reporting 12c-osb-message-reporting

12c OSB - DVM Implementation


Create a Service bus project

Create a Proxy schema:

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.proxyDVM.org"
targetNamespace="http://www.proxyDVM.org" elementFormDefault="qualified">
<xsd:element name="Request">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="CountryCodeIn" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Response">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="CountryCodeOut" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

Create a proxy wsdl based on the created schema.






Create a proxy and pipeline based on the created proxy wsdl.





Create a Country.dvm 




Open the pipeline and drag and drop pipeline pair node and take a assign activity and use the dvm to fetch the mapping values.

dvm:lookup('DVMSBProject/CountryCode', 'CountryName', $body/prox:Request/prox:CountryCodeIn, 'CountryCode', 'NotFound')


Now create one xquery to map this dvm output to proxy response.














Use the created Xquery in the replace activity



deploy to the server and test





Tuesday, June 16, 2020

MS Outlook Web - how to download mail from outlook web

You can drag and drop emails to add them as attachments as a workaround (see this answer). You can download an email like this:

Start a new message
Click to edit the message in a new window.
Select all emails you would like to download.
Drag the emails to the new message. This will add them as attachments.
Click the down arrow on the attachment and download the email message, or send the message to yourself and then download all attachments.

Monday, June 15, 2020

SOA 12c - Any type xml data to XML parsing

Here we will see how to accept AnyType Data(xsd:anyType) and convert it into a valid xml data.

Data to be passed as Any type XML string data:
<?xml version="1.0" encoding="UTF-8" ?>
<HREmployeeData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://www.example.org SOA/Schemas/XMLFormat.xsd" xmlns="http://www.example.org">
  <First>testF</First>
  <Last>testL</Last>
  <Phone>phNo</Phone>
  <Income>in</Income>
  <Status>Employed</Status>
  <JobHistory>
    <JobTitle>JT</JobTitle>
    <Salary>Sal</Salary>
  </JobHistory>
</HREmployeeData>

Create a Input and Output schema for a sync BPEL service.

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.example.org"
targetNamespace="http://www.example.org" elementFormDefault="qualified">
<xsd:element name="HREmployeeDataIn">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="AnyTypeXMLData" type="xsd:anyType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="HREmployeeDataOut">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="First" type="xsd:string"/>
<xsd:element name="Last" type="xsd:string"/>
<xsd:element name="Phone" type="xsd:string"/>
<xsd:element name="Income" type="xsd:double"/>
<xsd:element name="Status" type="xsd:string"/>
<xsd:element name="JobHistory">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="JobTitle" type="xsd:string"/>
<xsd:element name="Salary" type="xsd:double"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

Create the schema say "XMLFormat.xsd" which xml string data to be passed as input to the service.

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.example.org"
targetNamespace="http://www.example.org" elementFormDefault="qualified">
<xsd:element name="HREmployeeData">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="First" type="xsd:string"/>
<xsd:element name="Last" type="xsd:string"/>
<xsd:element name="Phone" type="xsd:string"/>
<xsd:element name="Income" type="xsd:double"/>
<xsd:element name="Status" type="xsd:string"/>
<xsd:element name="JobHistory">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="JobTitle" type="xsd:string"/>
<xsd:element name="Salary" type="xsd:double"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

Use the Input and Output schema and create a BPEL Service.
Open the BPLE Process and create a variable varXMLTypeData using XMLformat.xsd
Use parseXML() function to AnyTypeXMLDATA Input and store in varXMLTypeData variable

Please note that when you are selecting the anyType data, in Assign activity this will not get copied in the expression builder, hence you need to manually add this data.

oraext:parseXML($inputVariable.payload/ns1:AnyTypeXMLData)



Parsing done. Now assign the parsed elements to output elements

Deploy and test




Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...