Showing posts with label osb 12c dvm. Show all posts
Showing posts with label osb 12c dvm. Show all posts

Thursday, May 04, 2017

Securing OSB Proxy Service using OWSM : Simple guide

Service Bus is integrated with Oracle Webservices Manager (OWSM) that provides several out of the box security policies. You can use any of these OWSM policies to secure your Proxy Services based on requirements. Here in this post, you will use oracle/wss_username_token_service_policy policy to secure Proxy Service.
Steps Summary :
1.    Create Users who needs access
2.    Add policy to Service
3.    Test and Validate

Login to Admin Console and click Security Realms in Domain Structure.




Click myrealm as shown below.




Navigate to Users by clicking on Users and Groups tab.




Click New and enter credentials as shown below.



Click OK. 
Observe that new user has been created which can be used to invoke Proxy Service.







Go to sbconsole. Create a new session. Navigate to All Projects –> <<your project>> and open the Proxy service to bring up a new tab as shown below.




Click Security and choose the option as shown below.



Click Attach Policies icon (highlighted above) and select the policy as shown below and click Attach.




Click OK and observe that selected policy is shown up as shown below.


Save your changes in current tab and activate the session.


You can use SOAPUI or SBConsole Test service for testing.
Open request editor for any of your Proxy Service operations and paste the following in SOAP header. This represents the WS-Security header and is expected by OWSM policy i.e. attached to Proxy Service.

Test using wrong credentials or without security header and observe the output showing security error.



Test using credentials created in first section and observe the output.
Add below header to your request, You can see username and password fields below.
                                                              
<soap:Header>
                <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                                <wsse:UsernameToken wsu:Id="UsernameToken-F7A4A73DA710AE195C14938940405155">
                                                <wsse:Username>dheeraj</wsse:Username>
                                                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">webic123</wsse:Password>
                                                <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">T36cJsRsgb5IzQyyy/Yskw==</wsse:Nonce>
                                                <wsu:Created>2017-05-04T10:34:00.515Z</wsu:Created>
                                </wsse:UsernameToken>
                </wsse:Security>
</soap:Header>






That’s all.




Saturday, March 05, 2016

OSB 12c - For Each action

Hey guys !

In this Post I am going through the For Each functionality in OSB 12c.


Use Case 

Simple Integration  Scenarios, Where Source system payload has Repeated Nodes, Target System expects one node at a time.



Design


Step 1 : 

Create a OSB Project, Add a Pipeline. Inside Pipeline Add a For Each Action.





Step 2:

Provide the required data in For Each Properties. Shown below



This is all we need to Implement For Each. 
However we will have to further process the Data, This could depend on your Requirement.
For the Demo Purpose, I am Sending this data to a Business Service using Publish Action.


Step 3:

Add a Publish Action inside For Each. Add a Assign action to see the Payload of the For Each iteration in Testing. Screens Below





Step 4:

Export and Deploy your code to Server.



Testing







Request Payload

<?xml version="1.0" encoding="UTF-8"?>
<Envelope>
  <Message>
        <MessageID>1</MessageID>
        <OrderReport>
            <OrderID>102-4552-913811</OrderID>           
            <Item>
                <OrderItemCode>09588730573218</OrderItemCode>
                <SKU>05988-2066</SKU>                
             </Item>
        </OrderReport>
  </Message>
  <Message>
        <MessageID>2</MessageID>
        <OrderReport>
            <OrderID>102-4556812-97811</OrderID>           
            <Item>
                <OrderItemCode>09588730573218</OrderItemCode>
                <SKU>05988-20166</SKU>                
             </Item>
        </OrderReport>
  </Message>
  <Message>
        <MessageID>3</MessageID>
        <OrderReport>
            <OrderID>102-4556812-91371</OrderID>           
            <Item>
                <OrderItemCode>09588730573218</OrderItemCode>
                <SKU>05988-266</SKU>                
             </Item>
        </OrderReport>
  </Message>
</Envelope>


For Each output for Last Iteration

<Message>
<MessageID>3</MessageID>
<OrderReport>
<OrderID>102-4556812-91371</OrderID>
<Item>
<OrderItemCode>09588730573218</OrderItemCode>
<SKU>05988-266</SKU>
</Item>
</OrderReport>
</Message>



Thats All Folks !






Here are some other posts, which may interests you

1. Fusion Middleware 12c – SAP Adapter Configuration

http://osb-dheeraj.blogspot.in/2016/02/fusion-middleware-12c-sap-adapter.html

2. Oracle Integration Cloud Service (ICS)

http://osb-dheeraj.blogspot.in/2016/02/oracle-integration-cloud-service-ics.html


3. SOA Interview Questions : Service Oriented Architecture Interview Questions Part 1

http://osb-dheeraj.blogspot.in/2016/02/soa-interview-questions-service.html

http://osb-dheeraj.blogspot.in/2016/02/osb-12c-domain-value-map-dvm.html

Saturday, February 27, 2016

OSB 12c - Domain Value map (DVM)


Hey guys !

Here I am going through the Domain Value map (DVM) functionality in OSB 12c.
In the 12c versions of OSB, Support for the DVM is included, Hence lets discuss the use case and Steps to implement DVM.

Use Case 

Simple Integration  Scenarios, Where Source system, Which sends data to Target System needs domain conversion of values.

A very typical example is Country name to Country Code conversion using DVM, i.e. Source system sends Country name and Target system expects Country code.

Design


Step 1 :

Open Jdevloper 12c (Service Bus console can also be used), Create a Service Bus Project.
I have given name to project as 'SBProject_DVM'

Step 2:

Create Source and target Schemas or WSDL (This is not a essential Step). For better demonstration, I Have used WSDL.



Step 3:

Create a Domain value map (CountryName_Code.dvm) and Add the Domain Name and Values. Atleast 2 rows needs be added.




Step 4:

Create a XSLT mapper (CountryNameToCode.xsl), Choose Source and Target to this mapper from your WSDL.



Step 5 :

User mapper to drag and Drop mapping element, Shown below




Step 6:

Go to XSLT source view and Edit the code as below 




Add this snippet 

<CountryCode>          
            <xsl:value-of select="DVMFunctions:lookupValue (&quot;SBProject_DVM/CountryName_Code&quot;, &quot;Name&quot;, string(/ns0:process/ns0:CountryName), &quot;Code&quot;, &quot;Unknown&quot; )"/>
 </CountryCode>



Now if you go to Design view, the below design will be visible





Step 7:

Create a new Pipeline Based on your WSDL and go to design view.
Add Pipeline pair to it, 
Inside Request Pipeline add a Stage. Inside stage add a 'Replace' action.
Inside Response Pipeline add a Reply action with Success.




Step 8:

Lets go to Replace action and use the Earlier created XSLT mapper to do the DVM  task.




In the input Field add the Variable which contains input element, as below





Step 9:

Save your changes and Export is to deploy to Test Server or Deploy directly from Jdeveloper.





Testing 

Step 1:

Open the Pipeline, click on test button, this will open in new window







Step 2:

Edit the request payload and click on Execute button to test it.








Voila !
You have successfully created DVM using OSB 12c


You can download the sbconfig jar of this project from
https://drive.google.com/file/d/0BxHj0h0tnxxOWWVYVXVvTGtWUGs/view?usp=sharing





Here are some other posts, which may interests you

1. Fusion Middleware 12c – SAP Adapter Configuration

http://osb-dheeraj.blogspot.in/2016/02/fusion-middleware-12c-sap-adapter.html

2. Oracle Integration Cloud Service (ICS)

http://osb-dheeraj.blogspot.in/2016/02/oracle-integration-cloud-service-ics.html


3. SOA Interview Questions : Service Oriented Architecture Interview Questions Part 1

http://osb-dheeraj.blogspot.in/2016/02/soa-interview-questions-service.html