OSB-12c : Message Type Usecase

Apart from WSDL type’s services, we can create proxy and business service based on MessageType in oracle Service Bus.
Below are the Message Types supported in OSB

Business Service: Request: Binary, MFL, Text, XML
                                Response: Binary, MFL, Text, XML
                                           
Proxy Service: Request: Binary, MFL, Text, XML
                           Response: Binary, MFL, Text,XML

Create new folder and name it as “Messaging_Based_Service_UseCase”


Create sub folders as shown below





Create a Http based proxy service and name it as “Messaging_Based_ServiceTypePipeline”



Select service type as “Messaging” 
Note: Here in this for testing we have considered only ‘Text’ message type as remaining message types are covered earlier in MessageType section.
Request: text
Response: text





Add an ‘IF’ condition in pipeline with below logic.
($inbound/ctx:transport/ctx:request/tp:headers/tp:user-header[@name="Content-Type"]/@value)="text/plain"

In above logic we are checking content-type in $inbound, if content-type is equal to text/plain, we are considering this as success case. Else, error is raised.




If ‘IF’ condition passes, invoke ‘Messaging_MockService’ to get static valid response. Save the result content from Mock response into a variable called $response.






In Response action of Service callout, add a replace node to populate response from Mock service.




If ‘IF’ condition fails, Raise error with proper error code and description as below.
Error Code: 1001
Error Desc: Message Type Use case failed.



As mentioned above we have created a Mock service to get static response.



Here in pipeline we have included a replace activity to change body into below message.

“Message Type Use Case tested successfully.”



Deploy service into standalone local server. Once deployment is successful we can locate service in sb console.



Run Message_Based_ServiceTypePipeline 




Pass some valid text message in Request structure.




On Successful execution we will able to see response as below.



Comments

Popular posts from this blog

OSB-12C : XA Transactional Support feature

Static code analysis of Terraform .tf files using ‘Checkov’ — Secure your infrastructure

OSB12c : Schema Validation - Dynamic Validation