Wednesday Nov 12, 2014

OSB 12.1.3 My First Service

This blog post is really for my reference as I started playing with OSB 12.1.3 this week and noticed there is some tooling changes, especially in regards to xquery. I had a few issues trying to run my OSB when I used xquery. This may have been a red herring as there are other changes in 12.1.3 that I needed to come to grips with, i.e. splitting pipelines proxy services and the addition of adapters and transports in the one component pallet. This blog post steps through the procedures I used to implement a simple OSB service with a Webservice Proxy Service and a DB Adapter business service. I will call out what I initially tried and failed so you don't make the same mistakes.

  1. Firstly, create an OSB Application, your choice if you choose with OSB project or not.

  2. Create or use the OSB project created in step 1 and open up the composite overview.

  3. Right-Click the External Services swim lane and select Insert Adapters... -> Database. Configure the DB as you always have in SOA. As an optional extra you can deploy now to test that your business service works.

  4. Up until now there are no real issues, the tooling feels very similar to SOA Suite. The creation of the proxy service was slightly different to my experience in SOA Suite. When I develop an Exposed service in SOA Suite I create the service then link it to mediator, or BPEL, etc. I followed the same process in OSB and created the Proxy service before the pipeline and I think I ran into my first issue. What I do now is create a Pipeline first and configure the proxy service at the same time.

    Before we can create a proxy service or pipe line we need to have an xsd to be used as the base for the Proxy service.

  5. Drag a pipeline from the component pallet to the pipeline / split-join swimlane, and give a name for the pipeline.

  6. Click the create WSDL icon



  7. The WSDL configuration is very similar to what you do in SOA Suite. I have provided a screen shot of mine. I have 1 xsd called product.xsd, and it has the request and response elements in that file.



  8. The pipeline config should look like this. In my initial development that did not work I chose ws for webservice. I'm unsure if this gave me issues down the track but I would keep the transport set to http.



  9. Before I start to connect the pipeline to the business service I want to create the xQueries that will transform the Proxy service request and the the DB select.

    Right-click a folder (I created an xquery folder) in the OSB Project and select XQuery File 1.0 (you will notice that OSB 12.1.3 does not support XQuery 2004 a design time, only run time. Therefore if you need to edit upgraded 11g OSB projects with XQuery you need to do this manually)



  10. The creation of xQueries looks different from 11g. Don't stress if you follow these steps you will soon be in the comfort of mapping source and target schemas as we did in 11g in just a few quick steps.

    Name the xQuery, I also name the function the same a the xQuery



  11. Click the plus sign to add a source schema. At first impression it looks like everything is greyed out and nothing working. This is not the case, specify a name and click the the pencil to for sequence to specify the source schema.



  12. Once again the screen looks like nothing is enabled, this is expected. Click on the Schema Object Reference icon to select the schema



  13. When I first attempted creating my first xQuery I selected the xsd under the Application Schema Files folder, as this is what you do in a SOA composite. Then I remembered in OSB 11g you select the WSDL. The issue here is that there are 2 folders presented here. Select the element under the Imported Schema as presented below.



    I did try the element under the blank folder, but when I did this the xQuery map would not draw. Therefore if you have WSDLs as the source and target select the Imported Schemas. I have not tried this for WSDLs with the schema inline within the WSDL, you may have to select another folder.

  14. Your completed parameter should look something like this.



  15. The parameter should look like this



  16. Do the same for the target and repeat steps 12 - 15. In my instance I used a DB adapter, this creates the WSDL in the resources folder, it also provide a concrete WSDL. When I choose the target I choose the actual WSDL as the screenshot below shows.



  17. You have now completed the configuration of the xQuery, it should look something like this.



  18. Now its just a matter of mapping from source to target. I'm not going to go into details here as all mappings are different.

  19. In this example I have a synchronous webservice, I have mapped the request, but now need to map the response. Create a response xQuery using the steps 9 - 18.

  20. The final step is to configure the pipeline to route to the business service and assign all the variables.

    Open the pipeline and add a pipeline pair under the  Proxy service.

  21. In the Request Pipeline in Stage 1 add and Assign, and under that add a Replace, Do the same for the Response Pipeline. You will notice some red markers, these just mean that the actions have not been configured. We will do that in the following steps.



  22. Click on the Assign for the Request Pipeline and in the properties panel change the expression to a xQuery Resource.



  23. Choose the xQuery and assign the binding. It should look something like this.



  24. Now provide a variable that holds the mapped output, in my instance I created it as requestVar.



  25. In the Replace under the Assign and enter the values as per below. It may be difficult to see but there is a '.' under the location text box.

  26. Do the same for the Response Pipeline.

  27. The last step in the process is to route the business service. Under the Pipeline add a routing action and select the business service created in step 1.







  28. Save your project, you can now deploy your OSB and test. If testing in the service bus console make sure you test with the pipeline, not the proxy service. Testing the proxy service you see all the assigns and service calls as you got in 11g. Also introduced in 12C is the debugger in JDeveloper. You can set break points so you can step through the process for greater analysis of your code.

Have fun.

Monday Jun 20, 2011

Installing Eclipse for OSB Development

OSB provides 2 methods for OSB development, the OSB console, and Eclipse. This post deals with a typical development environment with OSB installed on a remote server and the developer requiring an IDE on their PC for development. As at 11.1.1.4 Eclipse is only IDE supported for OSB development. We are hoping OSB will support JDeveloper in the future.

To get the download for Eclipse use the download WebLogic Server with the Oracle Enterprise Pack for Eclipse, e.g. Oracle WebLogic Server 11gR1 (10.3.4) + Coherence + OEPE - Package Installer (wls1034_oepe111161_win32.exe).

To ensure the Eclipse version is compatible with your OSB version I recommend using the Eclipse that comes with the supported WLS server, e.g. OSB 11.1.1.4 you would install WLS 10.3.4+oepe.

The install is a 2 step process, install the base Eclipse, then install the OSB plugins. In this example I'm using the 11.1.1.4 install for windows, your versions may differ.
  1. You need to download 2 programs, WebLogic Server with the oepe plugin for your OS, and the Oracle Service Bus which is generally generic. Place these files in a directory of your choice.

  2. Start the executable



  3. I create a new Oracle Home for this installation as it don't want to impact on my JDeveloper install or any other Oracle products installed on my machine.



  4. Ignore the support / email notifications



  5. Choose a custom install as we only want to install the minimum for Eclipse. If you really want you can do a typical and install everything.



  6. Deselect all products then select the Oracle Enterprise Pack for Eclipse. This will select the minimum prerequisites required for install.



  7. As I'm only going to use this home for OSB Development I deselect the JRockit JVM.



  8. Accept the locations for the installs.


  9. If running on a Windows environment you will be asked to start a Node Manger service. This is optional. I have chosen to ignore.



  10. Select the user permissions you require, I have set to default.



  11. Do a last check to see if the values are correct and continue to install.



  12. The install should start.



  13. The install should complete successfully. I chose not to run the Quick Start.



  14. Extract the OSB download to a location of your choice and double click on the setup.exe. You may be asked to supply a correct java location. Point this to the java installed in your OS. I'm running Windows 7 so I used the 64bit version.


  15. Skip the software updates.


  16. Set the OSB home to the location of the WLS home installed above



  17. Choose a custom install as all we want to install is the OSB Eclipse Plugins.



  18. Select OSB IDE.



  19. For the rest of the install screens accept the defaults.



  20. Start the install



  21. There is no need to configure a WLS domain if you only intend to deploy to the remote server. If you need to do this there are other sites how to configure via the configuration wizard.

  22. Start Eclipse to make sure the OSB Plugin has been created. In the top right drop down you should see OSB as an option.



  23. Connecting to the remote server, select the Server Tab at the bottom

  24. Right-click in that frame and select Server.


  25. Chose the remote server version and the hostname



  26. Provide and name for your server if necessary, and accept the defaults



  27. Enter connection details for the remote server



  28. Click on the Remote server and it should validate stating its status.



    Now you ready to develop, Happy developing!

About

Discussions and Examples using Oracle Fusion Middleware. Some image links are broken when using Firefox, Safari, and Chrome. If you want to see the full image please use IE.

Twitter:@james8001

tumblr hit counter vistors, thanks for your support

Search

Archives
« July 2015
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
       
Today