Enabling Attachment Support in OSB – Oracle Service Bus

Oracle Service Bus (OSB) 12C has been simplified by enabling creation and modification of services right inside JDeveloper, alongside SOA development.  However, this has introduced a learning curve for developers to learn and adapt to OSB development using JDeveloper IDE.  A common use case for OSB service development is to allow attachments to pass through as part of the response.  In this post, we discuss about how it can be done in OSB 12C using JDeveloper.

Unlike SOA web service adaptors, OSB does not support attaching MTOM policy (oracle/wsmtom_policy) to the proxy or business services.

1

At design time, JDeveloper doesn’t restrict usage of MTOM policy, and it will compile without any errors. However, when the service is deployed, it will fail with the following error:

“[OSB-387177]OWSM Policy oracle/wsmtom_policy is not supported.”

To get our use case working, three steps are required.  The first is to remove the attached MTOM policies from the Proxy and Business services.  This will ensure there are no deployment failures.

The second change should be in the pipeline.  Open the pipeline and switch it to the “Configuration” view (the default is “Design” view).  Then, go to the “Message Handling” sub-tab and select the checkbox:  “XOP/MTOM Support”.

2

The third and final change required is in the Business Service.  Open the Business Service and go to the “Message Handling” sub-tab.  Select the checkbox:  “XOP/MTOM Support”.  Here, select the appropriate option, depending on whether you want an attachment (Include Binary Data by Reference) or inline data (Include Binary Data by Value).

3

After completing this configuration, the compilation and deployment will proceed without any issues.

Note: The output structure should be defined in XML schema with base64Binary as the element type. Here is a sample type definition:

<xsd:complexType name=”Document”> <xsd:sequence> <xsd:element name=”docId” type=”xsd:string”/> <xsd:element name=”documentData” type=”xsd:base64Binary”/> <xsd:element name=”documentMimeType” type=”xsd:string”/> </xsd:sequence> </xsd:complexType>

If you have any questions or comments, please leave them below and we’ll get back to you!

DevOps with Oracle Developer Service – Deploy SpringBoot application to Oracle ACCS

Developer need to follow agile way in developing application. DevOps is new way of Software development. Developers need to setup some support service before starting new project. This can be as follows-

  • Wiki  for document authoring and collaboration with your team members
  • Version Control
  • Automated build.
  • Code Reviews
  • Issues Tracking.

Many organization follows these standard for their development practice. But in Oracle Development stack, Some of things are quite new. And reading this article further will be more interesting for them.

Developer Cloud Service is answer for all support service you require. It comes with other cloud development services i.e.

  • Java Cloud Services.
  • Database Cloud Service
  • Java Cloud Service-SaaS Extension
  • Messaging Cloud Service
  • Mobile Cloud Service
  • SOA Cloud Service and
  • Application Container Cloud

The DevCS is a complete development platform provided as a service to enable an agile development process and to automate DevOps & delivery. It covers most of the DevOps cycle including Continuous Integration, Continuous Delivery and Collaboration.

Oracle Developer Cloud Service is a collection of similar software and services hosted on Oracle Cloud. Oracle Developer Cloud Service helps you to manage the application development life cycle effectively through integration with Hudson, Git, Maven, issues, and wikis. Using Oracle Developer Cloud Service, you can commit your application source code to the Git repository on the Oracle Cloud, track assigned issues and defects online, share information using wiki pages, peer review the source code, and monitor project builds. After successful testing, you can deploy the project to Oracle Java Cloud Service – SaaS Extension, publicly available Oracle Java Cloud Service instances, Oracle Application Container Cloud Service instances, or to an on-premise production environment.

Following are components in DevCs

  • Ant, Maven, Gradle, npm, Grunt, Bower, Gulp, Command line
  • Continuous Integration – Hudson
  • Issue Tracking
  • Code review
  • Deployment automation
  • Agile process management
  • Wiki
  • Version Management – Git
  • Build Automation
  • Activity Stream

    You can link DevCs with NetBeans and Jdeveloper very easily and work with it quite effectively. If your code is in external GitHub account, it can also map that and make it work for you. Looking at Oracle Development methodologies, DevOps is quite new terms and many organization is not ready with it. This can be great service for them . Specially Customer with Oracle Forms, Pl/Sql, Apex, ADF stack, this can be quite useful and you can set up whole environment in couple of hours. So definitely, it is worth for a give a try .

    Use CaseAn organization wants to setup DevOps practice with Oracle public cloud for Dev & test. However production still remains on premise. In such case Oracle Developer cloud service can deploy artifacts(e.g. JAR file) to JCS (Java cloud Service) or ACCS (Application container Cloud service). For making deployment in production, We will make artifact ready for deployment to Production and place in separate Git Hub location.


    I have spring boot application in Netbeans. Create connection from NetBeans to developer cloud service. Click on Team- Team Server- Add new server.


    Provide credentials and url of DevCs.


    After making connection to DevCs, create new project in Developer Cloud service or open project , if project exist in DevCs.




    Navigate to DevCs server to see whether project created in console.Open DevCs console, new project will created successfully.


    You can also create project in DevCs console as well. Select Security as private or shared.


    • Choose template for new project. There are multiple template available


    If you have existing local github account. You can also import from there as well . Click on Finish.


    After that , you will see something like


    Alright , now project is created in DevCs , which we created from Netbeans. Now we will start code uploaded in Code section.


    Now go to build section to create a build job. Here I have created a Job named “Master Build“. Go to the configure section of Master build. And click on Source Control tab. Here you need to configure repository info where code is checked-in.


    Now click on Build steps. Add build step “Invoke Maven 3”. And define appropriate goals configured in your maven.xml


    And then add maven goals and select pom.xml and provide profile.


    Go to post build section and select option to archive artifact. If you have Junit test cases select option to publish Junit test cases as well. It will show test results on Developer CS console. You can do configuration like

    Publish Javadoc,configure to build other jobs. Click on Save.


    You can set trigger point of these build using schedule.


    Now click on Build now. It will run that job for building the repository and show you status of that job. You Can also see Git Logs, Audit , Junit test result. It will take a while and show you progress of build.

    You can also configure notification for successful and failed build.

    See generated archive in artifacts of Last Successful build tab , under target. Expand and see that

    Click on Console to see build console

    Now, we have generated artifact successfully. Now we can configure deployment to Oracle ACCS. Click on ‘Deploy’ menu option configure & Deploy application in your ACCS account.

    Now Click on New configuration.Provide Configuration name, application name. Select Deployment target as Application Container cloud

    You can select different deployment target as below

    Select ACCS properties as follow and click save and Deploy.

    Now, you can see deployment status and artifact is deployed successfully to Oracle ACCS. Similarly, you can deploy application to Java cloud Service and Java cloud Service- SaaS Extension.

    You can stop, redeploy and change configuration easily.

    Now, if place artifact to separate GitHub location, we can also write another build job for that. It will move artifact from DevCs to GIT Hub. Navigate to Build and Click on New Job.

    In build steps configure build steps as Execute shell

    You can some command to copy archive to remote GitHub Location and push. Its normal command. That’s it. If you see, you can follow whole DevOps in Oracle Cloud easily and it will provide lots of features out of box. You can also configure on premise Jenkins with Developer Cloud Service using hook up. Read this Article.

    Keep looking this space for more article about Developer Cloud service in depth. Happy Learning Oracle Cloud.

OWSM Security Policy- Configure Password Digest

A familiar constraint we encounter when using Oracle Service Bus (OSB) Business Services is that they are required to be configured with the Username Token policy, where the password should not be text-based; rather, it should be in binary format with Nonce and Creation Time. The password should also use the same Password Digest – SHA Base-64 encoded format – for enhanced security implementation.

This type of security policy is not provided out of the box by Oracle Web Services Manager (OWSM).

This post will explain how to create the correct policy in a few quick steps.

To overcome the above security configuration issue, you will need to:

  1. Configure the WebLogic Server Security Realm providers to use Active types as the Password Digest.
  2. Configure a custom OWSM Security Policy to accept the password type as Password Digest.

Below are the detailed steps for the two high-level processes outlined above.

  1. Configure the WebLogic Server Security Realm providers to use Active types as Password Digest.
    1. Log in to WebLogic Console, and go to Summary of Security Realms >myrealm > Providers.  
    2. Create a new Provider (e.g. Custom GESB Provider) and select Type: DefaultAuthenticator.
2

                 c. Open the newly created provider, go to Configuration > Provider Specific tab, select the Enable Password Digest checkbox, and save changes.

3

d. Go to DefaultIdentityAsserter and Select wsse:PasswordDigest in Active Types.

4

                      e. Restart the WebLogic Server.

  1. Configure out-of-the-box WSM Security Policy for Password Digest.
    1. Log in to EM Console and go to WebLogic Domain > Web Services > WSM Policies
    2. Click on “oracle/wss_username_token_client_policy”, then click Create Like button
5

                    c. In the General tab, provide the name of the policy, leaving the other settings as is.

6

                     d. In the Assertions tab, select Digest as the Password Type, then select the Nonce Required and Creation Time Required check boxes, and click Save.

7
  1. The Policy you configured should be ready now.
8
  1. Restart the server.

The newly created OWSM policy can now be attached to your chosen process to provide CSF Key credentials. The policy will automatically create binary passwords and other required parameters.