Upload
vince-soliza
View
719
Download
1
Embed Size (px)
Citation preview
SOAP TO REST API PROXYWITH MULESOFT API GATEWAY
Vince Jason Soliza
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
From SOAP to REST
This presentation will show how to proxy an existing SOAP web service and expose it as a RESTful web service.
WSDL• Check if WSDL of the existing SOAP web service is accessible. If not then
get a copy of the WSDL file.
Add New Proxy API• Login to anypoint platform.• Click on APIs menu• Click Add New API• Fill up the API Details and click Add.
API Administration• Here’s the view of the API Administration after the new API is created.
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.
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.
Configure Proxy API• Associate the project to API Gateway
• Open proxy.xml configuration
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
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.
Configure Proxy API• Click define metadata to use dataweave graphical gui mapping.
• Map JSON request to web service request
Configure Proxy API• Add Transform Message after the web service consumer
• Add the property Content-Type with value application/json
Run in Anypoint Studio
Note: Make sure the default api gateway port of 8081 is available.
Test Actual API• Invoked the service with SOAP
Test the REST Proxy API• Invoked the service thru REST POST method with application/json media-type
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)
QUESTIONS?Please leave a comment