18
SOAP TO REST API PROXY WITH MULESOFT API GATEWAY Vince Jason Soliza

SOAP To REST API Proxy

Embed Size (px)

Citation preview

Page 1: SOAP To REST API Proxy

SOAP TO REST API PROXYWITH MULESOFT API GATEWAY

Vince Jason Soliza

Page 2: SOAP To REST API Proxy

Pre-requisites

• Anypoint Studio – Download it here https://www.mulesoft.com/platform/studio– Install Anypoint Studio plugin API gateway runtime 2.2.0

• Configure and Run On-Premise API Gateway– http://www.slideshare.net/VinceSoliza/onpremise-api-gateway-58451080

Page 3: SOAP To REST API Proxy

From SOAP to REST

This presentation will show how to proxy an existing SOAP web service and expose it as a RESTful web service.

Page 4: SOAP To REST API Proxy

WSDL• Check if WSDL of the existing SOAP web service is accessible. If not then

get a copy of the WSDL file.

Page 5: SOAP To REST API Proxy

Add New Proxy API• Login to anypoint platform.• Click on APIs menu• Click Add New API• Fill up the API Details and click Add.

Page 6: SOAP To REST API Proxy

API Administration• Here’s the view of the API Administration after the new API is created.

Page 7: SOAP To REST API Proxy

Configure Proxy API• While in API Administration, click configure endpoint.• Select Endpoint with a proxy• Change the Type to HTTP• Write any url because we will be replacing that later• Un-check Configure proxy for Cloudhub?since we’re deploying in on-premises• Use HTTP scheme• Enter desired port and path• Click Save.

Page 8: SOAP To REST API Proxy

Configure Proxy API• Download the proxy project with the latest api gateway version• Open Anypoint Studio and import the downloaded project with mule deployablearchive (.zip).• Browse the project in the package explorerand open mule-project.xml then set the runtimeTo api-gateway.

Page 9: SOAP To REST API Proxy

Configure Proxy API• Associate the project to API Gateway

• Open proxy.xml configuration

Page 10: SOAP To REST API Proxy

Configure Proxy API• Delete HTTP component and replace it with Web Service Consumer

• Create json file for the metadata definition that we’ll do later

Page 11: SOAP To REST API Proxy

Configure Proxy API• Configure the web service consumer using the WSDL of the SOAP service we want to proxy.• Add Transform Message beforeweb service consumer.

Page 12: SOAP To REST API Proxy

Configure Proxy API• Click define metadata to use dataweave graphical gui mapping.

• Map JSON request to web service request

Page 13: SOAP To REST API Proxy

Configure Proxy API• Add Transform Message after the web service consumer

• Add the property Content-Type with value application/json

Page 14: SOAP To REST API Proxy

Run in Anypoint Studio

Note: Make sure the default api gateway port of 8081 is available.

Page 15: SOAP To REST API Proxy

Test Actual API• Invoked the service with SOAP

Page 16: SOAP To REST API Proxy

Test the REST Proxy API• Invoked the service thru REST POST method with application/json media-type

Page 17: SOAP To REST API Proxy

Summary

• API Gateway converts SOAP to REST web service without too much complications.

• API Gateway able to consume SOAP web services using Web Service Consumer component.

• DataWeave (Transform Message) is Mule’s most powerful and versatile tool for transforming data.

• API Gateway app is deployed in Anypoint Studio (without using API Manager)

Page 18: SOAP To REST API Proxy

QUESTIONS?Please leave a comment