SOAP To REST API Proxy
-
Upload
vince-soliza -
Category
Software
-
view
714 -
download
1
Transcript of SOAP To REST API Proxy
![Page 1: SOAP To REST API Proxy](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/1.jpg)
SOAP TO REST API PROXYWITH MULESOFT API GATEWAY
Vince Jason Soliza
![Page 2: SOAP To REST API Proxy](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/2.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/3.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/4.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/5.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/6.jpg)
API Administration• Here’s the view of the API Administration after the new API is created.
![Page 7: SOAP To REST API Proxy](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/7.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/8.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/9.jpg)
Configure Proxy API• Associate the project to API Gateway
• Open proxy.xml configuration
![Page 10: SOAP To REST API Proxy](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/10.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/11.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/12.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/13.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/14.jpg)
Run in Anypoint Studio
Note: Make sure the default api gateway port of 8081 is available.
![Page 15: SOAP To REST API Proxy](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/15.jpg)
Test Actual API• Invoked the service with SOAP
![Page 16: SOAP To REST API Proxy](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/16.jpg)
Test the REST Proxy API• Invoked the service thru REST POST method with application/json media-type
![Page 17: SOAP To REST API Proxy](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/17.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062401/5871b4c51a28abda6a8b769f/html5/thumbnails/18.jpg)
QUESTIONS?Please leave a comment