Archive for the 'OSB' Category



Service Bus 12c– Two way SSL

In this post, we will see how to enable two-way SSL in Service Bus 12c. The steps mentioned here have to be performed in addition to steps mentioned in the previous post.

Navigate to Servers –> osb_server1 –> SSL in WLS Admin Console. Expand Advanced section and set Two Way Client Cert Behavior as shown below. This would enforce WLS to request the Client certificate during SSL handshake and will result into an error if the client certificate is not present in trust store.

2ssl

Now create a keystore clientkeystore1.jks using following command and will  be used in SOAP UI.

keytool -genkeypair -keyalg RSA -alias localclient1 -keystore clientkeystore1.jks -storepass cljks123 -validity 360 -keysize 2048

Set global SSL Settings in SOAP UI as shown below by navigating to File –> Preferences. Specify the above created keystore and  password.

soapui

Restart OSB managed server. Now if you test your Proxy Service from SOAP UI, you would see an error like below in the server log as the trust store does not have the client certificate.

sslerror

So export and import corresponding Client Certificate into the OSB trust store using following commands.

keytool -exportcert -alias localclient1 -keystore clientkeystore1.jks -file localclient1.cer

keytool -importcert -alias localclient1 -keystore osbkeystore.jks -file localclient1.cer

clientstore

Now test your Proxy Service from SOAP UI and you would see the response as expected without any error. And now the server log will be shown like below.

sslsuccess

Please note that above logs are generated when following JVM options are set in setDomainEnv.cmd file for EXTRA_JAVA_PROPERTIES.

           -Dssl.debug=true -Dweblogic.StdoutDebugEnabled=true

Advertisement

Service Bus 12c– One way SSL

In this post, we will see how to configure Service Bus to use One way SSL.

Here, we are not discussing about the SSL concepts and people who want to go through quick introduction of SSL can go through this.

In Summary, following are the steps to be followed:

  • Generate Custom Identity and Trust stores.
  • Enable SSL port.
  • Setting up the keystores.
  • Configure private keys for SSL

Please note that, JSSE (Java Secure Socket Extension)  is the only supported SSL implementation. The Certicom-based SSL implementation is removed and is no longer supported in WebLogic Server.

Create a folder keystores %FMW_HOME% to store all of your keystores used and issue the following command to generate a keystore for Admin server use as shown below.

keytool -genkeypair -keyalg RSA -alias localadmin -keystore adminkeystore.jks -storepass adjks123 -validity 360 -keysize 2048

createks

This creates keystore adminkeystore.jks having both public and the private keys with alias localadmin. You can observe the contents of keystore using the following command.

keytool -list -v -keystore adminkeystore.jks

jkscontents

Similarly, create other keystores to use for OSB and SOA managed servers and also a keystore to use for the client as shown below.

keystores

Enable SSL port by navigating to Environment –> Severs-> Admin Sever –> General.

sslenable

By Default, WLS uses the Demo Identity and Trust keystores and you can find them in %DOMAIN_HOME/security and %WLS_HOME%/server/lib. Oracle strictly recommends to use the Custom keystores at least for the Production environments. Hence we will use the custom keystores in this post.

Go to Keystores tab and click Change.

demoks

Select Custom Identity and Custom  Trust as shown below and click Save.

customks

Modify Custom Identity and Trust stores as shown below and here you also need to give keystore password. Click Save.

customks1

Go to SSL tab and give the Private key alias as shown below.

sslsetup

Go to Advanced settings and set Hostname verification to None and also set Two way Client Cert Behavior to Clients Certs not Required as we are doing setup for 1-way SSL. This setting will enforce WLS server not to request client certificates.

sslsetup1

Modify EXTRA_JAVA_PROPERTIES  in setDomainEnv.cmd to use following parameters and restart the admin server. This is required as to instruct WLS server to load trusted certificates.

-Dweblogic.security.SSL.trustedCAkeystore=C:\Oracle\Middleware\FMW1213New \keystores\adminkeystore.jks -Djavax.net.ssl.trustStorePassword=adjks123

Now you should be able to access WLS admin console using following URL and this confirm the SSL is configured on your admin server.

http://localhost:7002/console

You can refer to WLS documentation here for more information on this.

The following error is observed when we use a keystore as Trust store with zero trust certificates.

<[Thread[DynamicJSSEListenThread[DefaultSecure3]],9,WebLogicServer]weblogic.security.SSL.jsseadapter: TRUSTSTORE_MANAGER: No certs to
copy.>
<[Thread[DynamicJSSEListenThread[DefaultSecure3]],9,WebLogicServer]weblogic.security.SSL.jsseadapter: TRUSTSTORE_MANAGER: No trusted
CAs available to populate trust anchors.>
<[Thread[DynamicJSSEListenThread[DefaultSecure3]],9,WebLogicServer]weblogic.security.SSL.jsseadapter: TRUSTSTORE_MANAGER: Error initi
alizing trust manager factory: the trustAnchors parameter must be non-empty.
java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200)
at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:120)
at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:104)
at weblogic.security.SSL.jsseadapter.JaTrustManager.<init>(JaTrustManager.java:57)
at weblogic.security.SSL.jsseadapter.JaSSLContextImpl.initializeContext(JaSSLContextImpl.java:654)

To debug SSL, modify EXTRA_JAVA_PROPERTIES  in setDomainEnv.cmd to include the following parameters.

-Dssl.debug=true -Dweblogic.StdoutDebugEnabled=true

To enable javax.net debugging include the following parameter.

-Djavax.net.debug=all

To eliminate this error, you can install any trust certificate into localadmin.jks or use cacerts keystore (available in %WLS_HOME%/server/lib) as Trust store. Here i have exported Public Certificate from clientkeystore.jks and got that imported into localadmin.jks.

Use the following command to export:

            keytool -exportcert -alias localclient -keystore clientkeystore.jks -file localclient.cer

Use the following command to import:

             keytool -importcert -alias localclient -keystore adminkeystore.jks -file localclient.cer

Now verify the contents of your keystore as below.

              keytool -list -v -keystore adminkeystore.jks

localcer

Similarly, configure OSB managed server using keystore osbkeystore.jks and use 7005 as the SSL port. Restart the OSB server after your changes.

osbsslport

osbsslks

osbsslks1

To enable your proxy services to be accessed only by SSL, you have to enable HTTPS option as below.

osbsslps

Now if you try to access your Proxy Service WSDL from browser, it will be automatically uses SSL as shown below.

osbwsdl

Most of the people uses SOAP UI to test their webservices. If you try to access this WSDL, you will be able to access from SOAP UI even without adding the required certificates to trust store. This is because SOAP UI trusts all by default as per this forum post.

To confirm the enablement of SSL on the Proxy Service, let us try to create a Webservice Proxy in JDeveloper that prompts to accept/trust the certificate.

jdevcert

Observation:

When you enable SSL debugging, you might observe the following exception in server log though your 1-way SSL works as expected. As per Oracle Support note 1606295.1, this is not a harmful exception.

<1425221899641> <BEA-000000> <Exception processing certificates: peer not authenticated javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:397)
at weblogic.servlet.provider.WlsSecurityProvider.getSSLAttributes(WlsSecurityProvider.java:222)
at weblogic.servlet.internal.VirtualConnection.initSSLAttributes(VirtualConnection.java:165)
at weblogic.servlet.internal.VirtualConnection.init(VirtualConnection.java:75)
at weblogic.servlet.internal.ServletRequestImpl.initFromRequestParser(ServletRequestImpl.java:312)
at weblogic.servlet.internal.HttpConnectionHandler.dispatch(HttpConnectionHandler.java:577)
at weblogic.servlet.internal.MuxableSocketHTTP.dispatch(MuxableSocketHTTP.java:131)
at weblogic.socket.JSSEFilterImpl.dispatch(JSSEFilterImpl.java:216)
at weblogic.socket.MuxableSocketDiscriminator.dispatch(MuxableSocketDiscriminator.java:186)
at weblogic.socket.JSSEFilterImpl.dispatch(JSSEFilterImpl.java:216)
at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:970)
at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:907)
at weblogic.socket.NIOSocketMuxer.process(NIOSocketMuxer.java:495)
at weblogic.socket.NIOSocketMuxer.processSockets(NIOSocketMuxer.java:461)
at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:30)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:43)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:147)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:119)

SOA 12c – Using Maven for Service Bus deployment

In this post, we will see creation of Service Bus application and projects using maven archetypes. And we will use local Maven Repository for demonstration.

Generate Service Bus Application and Project as shown below.

mvn archetype:generate -DarchetypeGroupId=com.oracle.servicebus.archetype -DarchetypeArtifactId=oracle-servicebus-application -DarchetypeVersion=12.1.3-0-0 -DgroupId=org.my.test -DartifactId=test-servicebus-application -DprojectName=test-servicebus-project -Dversion=1.0-SNAPSHOT

Import this maven project in JDeveloper using the steps mentioned below. Select File –> Import and select Maven Project option and click OK.

import1

osbimport

osbappl

osbimported

Open application level POM file in Application Resources directory as shown below and observe the details.

osbapplpom

osbapplpom1

Open project level POM file and observe the details.

osbprojpom

Open System level POM file and observe the details.

osbsyspom

Add plugin and other server details in project level POM files (both System and Service Bus Project) as shown below. Remember using the Admin Server port as the server url.

<build>
<plugins>
<plugin>
<groupId>com.oracle.servicebus.plugin</groupId>
<artifactId>oracle-servicebus-plugin</artifactId>
<version>12.1.3-0-0</version>
<configuration>
<oracleServerUrl>
http://localhost:7001</oracleServerUrl>
<oracleUsername>weblogic</oracleUsername>
<oraclePassword>weblogic1</oraclePassword>
</configuration>
</plugin>
</plugins>
</build>

You can generate the sbar file for your Service Bus Projects using mvn package (from directory of Service Bus Application) and can be found in <<project>>/.data/ maven.

sbuspackage

Deploy your Service Bus projects using mvn pre-integration-test (from Service Bus application directory).

sbuspinttest

You can execute Service Bus Plugin goals in following manner from directory containing project POM file.

mvn com.oracle.servicebus.plugin:oracle-servicebus-plugin:package

mvn com.oracle.servicebus.plugin:oracle-servicebus-plugin:deploy**

You can observe goal prefix as servicebus, when you describe Service Bus Plugin as shown below.

osbgoalprefix

so you can execute all goals simply using this goal prefix as below.

mvn servicebus:package

mvn servicebus:deploy**

 

**Currently facing issue with deploy goal.

 

Notes:

  • Use double quotes in the maven commands like below if you are seeing the error mentioned in think link.

mvn install:install-file “-DpomFile=oracle-maven-sync-12.1.3.pom” “-Dfile=oracle-maven-sync-12.1.3.jar” “-DoracleHome=C:/Oracle/Middleware/FMW1213New”

  • Seems to be OSB maven functionality is broken in 12.2.1. Refer to following blog talking about this.

https://rhpatrickblog.wordpress.com/2015/11/11/restoring-osb-12-2-1-maven-functionality/

http://www.avioconsulting.com/blog/osb-12212-maven-fixes

SOA 12c–EDN with Service Bus

In this post, I just want to present an idea on how to make Service Bus work with EDN in SOA Suite 12c. For demonstration purpose, I will consider Durable Subscriber functionality introduced in 12c.

You can download the SOA and Service Bus projects here and here.

My setup includes 2 business events Create Order and Update Order and have the following durable subscribers created because of SOA Composites. Refer to these articles for more information on EDN. Note that, Client ID is different as mentioned below based on the consistency level used for the event subscription.

       For Guaranteed   -> edn_wljsm_localtx_client

       For OneandOnlyOne   -> edn_wljsm_xa_client

Main idea is to create a durable subscriber for our Proxy Service similar to the ones shown below. So note down Client ID and Message Selector shown below and use it in our Proxy Service configuration. Here we are subscribing our Proxy Service to Create Order business event.

soasubscr1

soasubscrmsgslet

Now create Proxy Service and set Endpoint URI in Transport tab as shown below. EDN uses EDN Topic for storing and delivering the EDN messages to subscribers.

topicps1

Give the Message Selector and Client ID noted in previous step in Transport Details tab as shown below and select Durable Subscription option.

topicps2

Deploy you Service Bus project and observe that another durable subscriber has been created for Proxy Service as shown below.

osbdura1

To make sure that things are working as expected, push the message read by Proxy service to other JMS queue. Here I created queue named CustomJmsQ and following screenshot shows no messages are pushed yet.

customqmsg

Raise the Create Order business event from SOA Composite. And you can observe that message payload have been inserted into JMS queue.

custommsgaftrtest

evntpayloadjms

Shut down OSB managed server and observe status of  durable subscriber. As shown below the Active status is shown as false indicating that Proxy service is not longer ready to accept messages.

osbinactive

Again raise the Create Order business event. And now you can observe that message is shown in Current Count means not yet delivered to Proxy Service.

pendingmsg

pendingmsg1

Now restart your OSB managed server navigate to CustomJmsQ. Now you can observe 2 messages in this queue including the latest one as shown below.

osbsrvrrestart1

osbsrvrrestart2

Now Un-deploy Service Bus project. And you can observe that corresponding durable subscriber is deleted too.

Remember the following:

  • EDN bus comes with SOA server, so you may not be able to use EDN in OSB only deployments.
  • Since there is no native support for business events in service bus, we will not be able to set any consistency levels and even the retry would not happen similar to SOA composites.
  • Here we directly gave Endpoint URI of Proxy Service to point to EDNTopic residing different server. Ideally, you may have to go for foreign server.
  • Finally, I have not verified the same with client edn_wlsjms_xa_client. Please let me know in comments when you try.

Service Bus 12c- Mixing URI Parameters and Payload in REST Service

Typically, a PUT request URI looks like below accepting the actual payload in HTTP body.

http://host:port/employeesApi/Employees/{employeeId}

In Service Bus12c, We cannot mix URI parameters with representation of the resource, when we want to define a resource in this way.

put

If we run Proxy Service with this setup, we will get an error as shown below.

put1

put2

put3

Instead, you can use the expression as shown below.

put4

You can access this using the following expression from your message flow.

$inbound/ctx:transport/ctx:request/tp:user-metadata[@name=”empid”]/@value

If you log $body and above expression, you would see the log messages as shown below.

put5

put6

As explained in this link, you may have to populate these URI parameters in outbound variable.

Service Bus 12c – REST enabled Business Services

In this post, you will learn to create REST enabled business services. We will create business service to call the Proxy Service created in previous post.

You can create Business Services directly using WADL if it’s available, or using REST binding wizard similar to Proxy Services. As mentioned earlier, REST Business services convert payload from SOAP to REST i.e. the internal interface is still based on WSDL, while the external business and proxy services expose REST endpoints.

Using WADL:

Drag REST binding into External Services swim lane in Service Bus overview editor as shown below.

restcmp_thumb2

bizrest1

Give name as EmployeeBS and Base URI and choose the option as shown below in Operation binding.

bizrest2

Select the WADL as shown below. You can also observe that you can choose resource from several places including MDS.

bizrest3

Click OK and verify that Operation Bindings are populated as shown below.

bizrest4

Click OK to finish the Business service creation.

Using REST Binding:

The steps for creating REST binding for business service are similar to Proxy Service. So follow the steps mentioned in section Creating REST Binding of previous post except giving the base URI.

Testing:

Run the business service and you will observe both SOAP and REST interfaces as shown below along with available operations.

testbiz

testbiz1

/Employees Resource:

GET:

getxml

getxml1

getjson1

getjson2

POST:

postxml1

postxml2

postjson1

postjson2

PUT:

putxml

putxml2

putjson1

putjson2

/Employees/{employeeId} Resource:

GET:

getxml2

getxml3

getjson3

getjson4

DELETE:

deletexml

deletexml.1jpg

deletejson

deletejson2

Similarly, you can run SOAP interface of business service by choosing operation and observe the output.

Service Bus 12c – REST enabled Proxy Services

Note: This post is based on SOA 12.1.3 release.

In this post, you will learn to expose Proxy Services as REST services. We will use Employees table and come up with REST API that can be used to perform CRUD operations.

This post assumes knowledge of DB connection pool setup and Pipelines.

Creating Business Service

Create the business service using DB Adapter with the help of following steps.

dbadapter1

dbadapter2

dbadapter3

dbadapter4

dbadapter5

dbadapter6

dbadapter7

dbadapter8

dbadapter9

dbadapter10

dbadapter11

dbadapter12

dbadapter13jpg

dbadapter14

Click Finish and verify that business service has been created as shown below.

filexp

Refactor all the artifacts to BusinessService directory.

filexp1

Now you can test business service alone to make sure that all operations are working fine as expected. You can refer to this post for detailed steps.

Creating REST Binding

We want our REST resource to support the following operations:

Resource

HTTP Verb

Resource URIs

Desription

Employees GET /Employees Get all employees
GET /Employees/{employeeId} Get an employee represented by Employee ID.
POST /Employees Create new employee
PUT /Employees Update new employee
DELETE /Employees/{employeeId} Delete an employee represented by Employee ID.

In Service Bus 12c, REST proxy services convert REST native payload to SOAP before invoking a pipeline or split-join, while REST business services convert payload from SOAP to REST. That means, the internal interface is still based on WSDL, while the external business and proxy services expose REST endpoints. This will be evident in later steps as service bus creates both WADL and WSDL files and each resource is mapped to different operations defined in WSDL.

Drag REST binding into Proxy Services swim lane in Service Bus overview editor as shown below.

restcmp

proxy1

This brings up Create REST binding window. Give the name as shown below.

restbind1

Click + icon for Resources to add new resource and click OK.

restbind2

Similarly add another resource /Employees/{employeeId}. Now your resources should look like below.

restbind3

Now you have to create the corresponding Operation Bindings which in turn creates WSDL with these operations.

Operation Bindings for resource /Employees:

Use the following steps to create GET mapping.

restbind4

get1

get2

Here we are selecting both XML and JSON as we want our API to support both content types. Click on highlighted icon to define schema on fly representing the output payload. Enter file name and give directory name as ProxyService as shown below.

xsd1

Click Next and choose file type as JSON.

xsd2

Click Next and give Target namespace and Root element as shown below and you can use the following JSON payload sample.

{
“Employee” : [{
“employeeId”: “100”,
“firstName”: “fname”,
“lastName”: “lname”,
“email”: “fn@gmail.com”,
“phoneNumber”: “9848012345”,
“jobId”: “100”,
“salary”: “100”,
“commissionPct”: “100”,
“managerId”: “100”,
“departmentId”: “100”
},
{
“employeeId”: “101”,
“firstName”: “fname1”,
“lastName”: “lname1”,
“email”: “fn1@gmail.com”,
“phoneNumber”: “9848012345”,
“jobId”: “100”,
“salary”: “100”,
“commissionPct”: “100”,
“managerId”: “101”,
“departmentId”: “101”
}]
}

xsd3

Click Next and verify the schema that gets generated.

xsd4

Click Next and Finish and verify that schema URL is populated in Response tab.

restbind5

Click OK and verify Operation Bindings are populated as shown below.

restbind6

Use the following steps to create POST mapping by reusing existing schema.

post1

post2

post3

post4

post2

post5

Similarly, finish mapping for PUT and use operation name as updateEmployee. Now your Create REST binding window should look like below.

3ops

Click OK. You will observe that Proxy Service, WADL and WSDL have been  created as expected.

filexp2

You will also observe errors, as XSD file is created in ProxyService folder whereas WADL and WSDL got created in Resources folder. So open WADL and WSDL files and modify the XSD reference as shown below to resolve errors.

wadl

wsdl

Operation Bindings for resource /Employees/{employeeId}:

You should reuse the schema created in above steps for this resource as well.

Now in Service Bus overview editor, right click EmployeeService and select Edit REST as shown below.

editrest

Use the following steps to create GET mapping.

rsrcget5

empkey1

You can leave schema for request as it is so that it will be defaulted by the wizard.

rsrcget3

post2

rsrcget4

Click OK and your Update Service window should look like below.

rest1

Similarly finish DELETE method by using operation name as deleteEmployee and now your Update Service window should look like below.

allbinds

Click OK and observe the WADL and WSDL files that got updated with your new operation bindings. If you observe that WADL is not updated just do refresh as shown below.

refresh

WADL:

wadl1

WSDL:

wsdl1

 

With this, you have finished the REST interface that is exposed to consumers.

Creating Pipeline:

Create new pipeline EmployeePipeline using EmployeeService.wsdl as shown below.

pipeline1

pipeline2

Connect EmployeeServcie proxy service with EmployeePipeline in Service Bus overview editor as shown below.

soverview1

We will not discuss much about finishing the message flow in pipeline as it’s nothing different from regular scenario. You can find the Service Bus project here i.e. used for demonstration purpose in this post.

Testing:

In test console, you can observe that Accept http header shows both application/xml and application/json i.e. now your REST service supports both xml and json data formats.

GET With application/xml:

gettetsing1

gettetsing2

GET With application/json:

gettetsing3

gettetsing4

POST With application/xml:

posttest1

posttest2

POST With application/json:

posttest3

posttest4

You can observe that both records have been inserted as expected.

posttest5

PUT With application/xml:

puttest1

puttest2

PUT With application/json:

puttest3

puttest4

You can observe that both records have been updated as expected.

puttest5

Resource /Employees/{employeeId}:

GET With application/xml:

getkeytest1

getkeytest2

GET With application/json:

getkeytest3

getkeytest4

DELETE With application/xml:

deltest1

deltest2

DELETE With application/json:

deltest3

deltest4

You can observe that both records have been deleted as expected.

deltest5

If you want to expose SOAP interface as well, then you just need to create another Proxy Service and join EmployeePipeline as shown below.

soaprest

Notes:

  • We did not talk about fault handling specific details here.
  • It’s always recommended not to do blind GET as we may see performance issues when large number of records are there.
  • As an exercise, you can come up with resource emulating QBE on db.

References:

https://docs.oracle.com/middleware/1213/osb/develop/GUID-C346DF7D-041D-4E10-BE1C-451F50719106.htm#OSBDV88210

Service Bus 12c – Series of Articles

Published following series of articles related Service Bus 12c. Hopefully it helps the people who want to get hands dirty.

Service Bus 12c – Creating Proxy Services

In Service Bus, Proxy Services provide an interface to Service Consumers. In this post, you will see different ways to create Proxy Servicse using JDeveloper based on a WSDL. And for demonstration purpose, we will consider Service Bus project and WSDL as shown below.

biz1_thumb[2]

Method 1:

Right click Service Bus project and select New –> Proxy Service. You can also select Pipeline in this context menu and check the option Expose as a Proxy Service in step2 of wizard.

clip_image001

Give a meaningful name for Proxy Service as shown below.

clip_image002

Click Browse WSDLs icon and select CustomerService WSDL.

method2ps4

Click OK to go back to Create Proxy Service wizard. Retain Generate Pipeline selection so that wizard will create both Proxy Service and Pipeline for you.

clip_image002[10]

Method 2:

Open the Service Bus overview file (file with same name as your project) and drag HTTP adapter into from Components –> Service Bus –> Technology –> HTTP into Proxy Services swim lane to bring up Create Proxy Service wizard as shown below.

adapter1_thumb[2]

method2ps1

method2ps

Give meaningful name for Proxy Service and click Next. Select WSDL option and select WSDL as shown in previous method by clicking Browse WSDLs icon.

method2ps2

method2ps3

Method 3:

Right click WSDL in Service Bus project and select Service Bus –> Generate Proxy Service as shown below. You can also select Generate Pipeline in this context menu and check the option Expose as a Proxy Service in step2 of wizard.

m3ps

Verify that Create Proxy Service wizard has come up showing WSDL and binding selected.

m3ps2

The following steps are common irrespective of above methods you choose to create Proxy Service.

Click Next and give Endpoint URI as /entity/CustomerService. So service consumers can access your proxy service using URL as given below.

:/entity/CustomerService”>http://:/entity/CustomerService

clip_image002[12]

Click Finish to bring up CustomerPS.proxy window showing properties of your Proxy Service. Go to Message Handling tab and select SOAPAction Header as Selection Algorithm. This would enable proxy service to determine operation at runtime based on SOAP Action in HTTP headers. You can retain the default option SOAP Body Type unless no 2 operations share same payload structure.

 

clip_image003

Now your Service Bus project should show both Proxy Service and Pipeline as shown below.

finalps

Service Bus 12c – MDS Support

In OSB 11g, sharing of resources (WSDL, XSD, XSLT etc…) typically happens using a common OSB project i.e. you create all common resources in single project and refer it from other OSB projects wherever required. In Service Bus 12c also, you would be following the same approach for sharing resources but now you can access resources from MDS. This is very much helpful when you have SOA implementation with MDS and trying to create virtualization layer on top of these services using those WSDLs.

In this post, you will learn to export your resources to MDS and refer resources (wsdl) from MDS to create Business and Proxy Services.

By default, your 12 JDeveloper has a default file based MDS repository and a MDS connection  is configured in IDE Connections to access that. The default MDS connection is called SOA_DesignTimeRepository and is shown below. You can use this connection to publish and access the resources.

Navigate to Window -> Resources -> IDE Connections -> SOA-MDS to view the configured MDS connection.

clip_image001[4]

You can observe the properties on right click of SOA_DesignTimeRepository and can see actual location of MDS repository in File System. If required, you can modify this to point to some other location.

clip_image003[4]

JDeveloper supports different operations like Create Folder, Export, Import and Delete of these resources from MDS. And you can also transfer MDS contents to other MDS repository. It’s highly recommended to have some standard folder structure in MDS enabling consumers to quickly locate and access the resources. We will create the following folder structure in MDS:

apps -> ServiceBus -> <<ProjectName>> -> wsdl/xsd/dvm/xslt

Right click on SOA_DesignTimeRepository, select Create Folder and give ServiceBus as folder name.

clip_image004[4]

Similarly, create folders representing your project and wsdl directory as shown below.

clip_image005[4]

Publishing Resources to MDS:

Right click on any resource like WSDL, XSD, XSLT, XQuery and DVM in your Service Bus project and select Service Bus -> Publish To SOA Designtime Repository as shown below.

clip_image007[4]

Choose the appropriate folder as shown below. You also have the option of creating new folders in this wizard.

clip_image009[4]

Click Next. Select overwrite property as per your requirements to override any existing resource with the same name. Here you can observe the resource Target URL which can be used to refer in your SOA Composites. Click Finish to complete the publish.

clip_image011[4]

Note: if you are unable to view resources in MDS repository after publish, do Refresh by selecting SOA_DesignTimeRepository on right click.

Creating Business Service using WSDL from MDS:

Right click on your Service Bus project and select New –> Business Service.

createbiz

Enter a meaningful name for business service and click Browse WSDLs icon.

createbiz1

Click SOA-MDS tab as shown below and select the WSDL.

createbiz2

Click OK and observer that Import Service Bus Resources wizard appears as shown below.

importwsdl

You can accept default location or can select different location for WSDL in your Service Bus project. Click search icon for Import Location.

importwsdl

Select the required folder and click Select to go back to Import Service Bus Resources wizard.

importwsdl1

Verify the Import Location is shown as the folder you selected and click Next.

importwsdl2

Click Next.

importwsdl3

Click Finish and verify that binding has been selected in Create Business Service wizard as shown below.

createbiz3

Click Next and enter the Endpoint URI of your actual service.

createbiz4

Click Finish and observe that selected wsdl is imported into Service Bus project and a new business service is created.

biz

Similarly, you can create Proxy Services using WSDL from MDS repository and refer resources like XQuery, XSLT and DVMs from SOA-MDS tab in Resource Chooser in message flow.

Observe that there is still no direct way to refer resources from MDS repository in Service Bus 12c and resources always gets imported into project as shown above.


Pages

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 379 other subscribers

Enter your email address to follow this blog and receive notifications of new posts by email.


%d bloggers like this: