Top Banner
Expose a DataBase through SOAP over HTTP Kunal Mittal Integration Expert – Integration COE Sankar Santosh kenguva Practice Manager - Integration
18

Ice cxf component.pptx

Jan 28, 2018

Download

Software

Shankar Kenguva
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Ice   cxf component.pptx

Expose a DataBase through SOAP over HTTP

Kunal MittalIntegration Expert – Integration COE

Sankar Santosh kenguvaPractice Manager - Integration

Page 2: Ice   cxf component.pptx

Agenda

❖Introduction

❖Pre-requisites

❖Apache CXF

❖CXF Component in Mule

❖Simple Use Case

❖Conclusion

Page 3: Ice   cxf component.pptx

Introduction

● The principle behind this approach is our API LedConnectivity Methodology , which is an evolution of SOA.

● For years, most organizations have tightly coupled their frontend applications with the backend enterprise systemslike ERP and databases. The logic to access and process datafrom backend systems is baked directly into these front endapplications. If there is any change in the backend system, itturns into a very costly exercise to propagate that change toeach dependent application

Page 4: Ice   cxf component.pptx

Pre-requisites

❖ MuleSoft Anypoint Studio

❖ Database like MySQL, DB2, Oracle DB

❖ Soap-UI for Testing

Page 5: Ice   cxf component.pptx

Approach

Page 6: Ice   cxf component.pptx

Apache CXF

• Apache CXF is an open source services framework. CXF helps

you build and develop services using frontend programming

APIs, like JAX-WS and JAX-RS. These services can speak a variety

of protocols such as SOAP, XML/HTTP, Restful HTTP, or CORBA

and work over a variety of transports such as HTTP, JMS or JBI.

• CXF is often used with Apache Servicemix, Apache

Camel and Apache ActiveMQ in service-oriented architecture

(SOA) infrastructure projects

Page 7: Ice   cxf component.pptx

CXF Component In Mule

The Mule CXF module provides support for web service integration via Apache CXF. Apache CXF is an open source services framework that helps you build and develop services using front-end programming APIs, like JAX-WS.

The CXF Component was formerly known as the SOAP Connector.

Page 8: Ice   cxf component.pptx

Use Case

Expose a Database Through system API using SOAP over HTTP

Page 9: Ice   cxf component.pptx

Steps :

• Start MuleSoft Anypoint Studio and point to a new workspace.

• Create a new project. File -> New -> Mule Project

• Give a name to the project and click finish. You will see the mule configuration file where we can now add the Mule flows.

• Copy the schema and WSDL for loan service in the following directory path of the project, Project-Name/src/main/resources

• Add HTTP endpoint to the Mule configuration file. Dropping the HTTP endpoint on the canvas will automatically create a flow

• In the HTTP endpoint properties tab below click on connector configuration.

Page 10: Ice   cxf component.pptx

Step 1 :

Configure as Below and Click Ok

Page 11: Ice   cxf component.pptx

Step 2 :

Add value “loan” to the path variable in HTTP property.

Page 12: Ice   cxf component.pptx

Step 3:

Add the CXF component to the flow.

Page 13: Ice   cxf component.pptx

Step 4 :

Change the configurations for the CXF component to match the parameter from the WSDL. Add the WSDL location in the advanced tab.

Page 14: Ice   cxf component.pptx

Step 5 :

Add transformer “Dom to XML”.(Note: This transformer will convert the org.w3c.dom.Document object to XML message. This way we can apply XPath expressions to extract various values from the incoming message payload.)

Page 15: Ice   cxf component.pptx

Step 6 :

Add the database connector to look up the table.

Page 16: Ice   cxf component.pptx

❖ Configure the database with all the parameters.

❖ Configure the database connector property with the following select query by using the XPath query to extract the input parameter from the request payload.select * from loan where loan_id = #[xpath3("sch:getLoanRequest/sch:loanId")]

Page 17: Ice   cxf component.pptx

Step 7:

Start SOAP-UI and create a new project. Add a new WSDL and enter the link as follows: http://localhost:8081/bank/loan?wsdlRun the request and check the response

Page 18: Ice   cxf component.pptx

Thank you !