Tuesday 31 October 2017

SOA 12c JDeveloper: Error Unable to package module oracle.ide.ceditor.CodeEditorScrollableSectionView cannot be cast to oracle.tip.tools.ide.fabric.gui.components.DiagramEditor


If you are building your code in JDeveloper 12c and getting the below error in Deployment even though compilation is successful:

[06:05:14 PM] Deployment cancelled.
[06:05:14 PM] ----  Deployment incomplete  ----.
[06:05:14 PM] Unable to package module
[06:05:14 PM] oracle.ide.ceditor.CodeEditorScrollableSectionView cannot be cast to oracle.tip.tools.ide.fabric.gui.components.DiagramEditor

Well the solution is pretty simple.

Keep your composite.xml in design mode and rebuild. It will work.


Helpful? Please Comment.

Happy Learning!!

Monday 30 October 2017

ANT : How to get User, OS name and Environment properties

Here is what you need to do if you want to fetch below in/using ANT:

a. Logged user - built-in property
b. Machine OS name - built-in property
c. Environment properties - ANT provides a property task which has an attribute environment. Thus if you specify the task with environment="myenv" you will be able to access OS-specific environment variables via property names "myenv.PATH" or "myenv.TERM".


Below is a sample ant script.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="systeminfo">
  <target name="systeminfo">
    <property environment="my_env" />
    <echo>
      User is ${user.name}
      OS Name is ${os.name}     
      ANT_HOME is set to ${my_env.ANT_HOME}
    </echo>
  </target>
</project>
Output:

BuildFile: build.xml systeminfo
[echo]
[echo] User is nadimwarsi
[echo] OS Name is Windows 10 Enterprise
[echo] ANT_HOME is set to C:\Program Files\Java\jdk1.7
[echo] BUILD SUCCESSFUL
Total time: 0 seconds

Helpful? Please Comment.

Happy Learning!!

Wednesday 25 October 2017

SOA 12c Security : Create Users & Groups

Here is what you do if you want to create users or groups in WebLogic 12c.

1. Login to WebLogic server console
2. Navigate  to Security Realms on the Home page
3. Select myrealm
4. Click on tab Users and Groups
5. Click on Groups
6. Create new Group
7. Provide Name, Description and leave Provider default


8. Save
9. Now select the group created above, Click on Membership
10. Choose required group(example: Deployers) from available groups and Save.


Similarly,

1. Click on User
2. Create new User
3. Provide Name, Description and Password
4. Click on OK
5. Select the created User
6. Click on Groups tab
7. Select the Group from available ones based in the role you want to assign to User.
8. Save

Note: If you will not assign atleast one Group to the user, you will not be able to login to the console with that user

Login with this user and check access levels.

Helpful? Please Comment.

Happy Learning!!


Wednesday 18 October 2017

SOA 12c Security : SOADeployer role

Oracle Enterprise Manager Fusion Middleware Control supports the notion of role-based access. Users are mapped to different roles; each role corresponds to a different set of privileges. Using this mechanism, you can provision certain users with simple monitoring privileges (for instance view-only access), while administrators can be granted full access, including the ability to update configurations, restart servers, and so on.

The following roles have been defined for Oracle WebLogic Server in Oracle Enterprise Manager Fusion Middleware Control:

1. Administrator
2. Operator
3. Monitor

The actions that you can perform in Oracle Enterprise Manager Fusion Middleware Control are protected using Oracle WebLogic Server enterprise roles. To obtain the appropriate behavior in Oracle Enterprise Manager Fusion Middleware Control, you must correctly map either the user or enterprise role to the Oracle SOA Suite application role.

SOAAdmin -to- Administrator
SOAOperator -to- Operator
SOAMonitor -to- Monitor

There is no default mapping of the SOAMonitor and SOAOperator roles to Oracle WebLogic Server groups or users. These roles must be manually mapped in Oracle Enterprise Manager Fusion Middleware Control.

However we do not have any role SOADeployer.

This is what you should do if you want to create a custom role in Oracle EM Fusion Middleware control.

The role will have the below grants only:
1. Deploy Applications to WebLogic servers
2. Life-cycle SOA composites for all folders.

Steps:
1. Create SOADeployerUsersGroup
    a. Login to WebLogic console
    b. Navigate to Security Realms > myrealm > Users&Groups > Groups tab
    c. Create new Group SOADeployerUsersGroup
    d. Click on SOADeployerUsersGroup and under Membership tab add Deployers and Save.

2. Create Role
    a. Login to EM
    b. Navigate to WebLogic domain (soa_domain) > Security > Application Roles
    c. Select Application Stripe - soa-infra
    d. Create new Role SOADeployerCustomRole
    e. Under Membership section, Add > Group > SOADeployerUsersGroup
    f. Save

3. Create Principal
    a. On EM navigate to WebLogic domain (soa_domain) > Security > Application Policies
    b. Create Principal
    c. On Add Principal section, Search for Application Role > Select SOADeployerCustomRole
    d. Under Permissions, Click on Add
    e. Select Class - CompositePermission and filter Resource Name > Includes > *

       

    e. Select first resource and click on Next
    f. Under Customize, select read, provision and life-cycle
    g. Continue ans Save.

Now you can create a User in Weblogic Server add it to SOADeployerUsersGroup membership.

You can then deploy your code from JDeveloper or using scripts with this user to any SOA folder.

Helpful? Please Comment.

Happy Learning!!

Thursday 12 October 2017

OSB 12c : Email Polling with Attachment

This is what you should do if you want to use the email protocol to initiate your OSB service based on email in the Mail Inbox.

Overview:
The Proxy service polls the Mail Inbox for the new messages and invokes the Business service whenever there is a new message in the Inbox.
The polling interval can be specified in the Proxy Service configuration.

You can read the contents of the email or can process an email attachment.

We will be using the 12c JDeveloper to create the service. You can do the same on the service-bus console.

Steps:
1. Create an Service Bus Application and Project.



2. Name your application and project.





3. Once your application and project are created, create your folder structure like below:



4. First we will create a Service Account, with static username/password of the mail account.

 



5.  Save.
6. Now we will create a Business Service which will be invoked based on the email.

Note: This Business Service can do anything you want to do with the data you receive.
Example:
a. Invoke a service (say BPEL) with the email body payload as input or
b. Read the attachment and process to a file location using file transport

We will cover example b today.

7. Name the service and select file transport. We are not using the file adapter jca here.



8. Keep the Service Type below:

 

9. Define the server directory path starting with the root till the directory you want to place the file.



10. On the Business Service leave other values default, Save.
11. Open your composite.xml and on the External Services swim-lane  right click > Choose > Business Service > Select Business Service WriteEmail_BS > Ok






 You can also drag-drop your business service to the swim-lane.

12. On the middle swim-lane, Pipelines/Split Joins, right-click > Insert > Pipeline
13. Name your pipeline, change Location to Services\Proxy Service , Next


 
14. Define the Service Type as Messaging - Text/None and check Expose as a Proxy Service.
Name your Proxy Service with transport as email.



15. Finish.
16. Your composite should look like below:

 

17. Open the Proxy Service, click on the Transport tab and provide the mail server host and port



Here we are using Outlook Office 365 email server on port 993 or 143

18. Click on the Transport Details tab, select the service account we created, email protocol as imap, specify the polling interval as per requirement, select the Post Read Action as per the requirement and also specify the Download/Archive/Error directories accordingly and Save All.




19. Open you Pipeline, right-click and add a pipeline-pair node
20.  In the request pipeline stage add an Assign action. We will use it to get the attachment name.
This value is part of the context variable - $attachments
Use the below expression:



assign it to variable attachmentname.

 21. Add one Assign  and Replace actions to map the attachment contents to outgoing $body like below


 


22. Add one Publish action and set the target Service to the Business Service WriteEmail_BS.bix
23. Inside the Publish insert a Transport Header action, with below parameters




Test:

Send an email to the user account email.


This will trigger your service and as a result write the attachment to the file location on the server.


Helpful? Please Comment.

Happy Learning!!

OSB 12c : Dynamic Routing to Business/Proxy Service

Dynamic routing is a kind of  Content-based Routing pattern, which is used when the BusinessService/ProxyService path is required to be de...