munkee
munkee

Reputation: 769

AWS API Gateway & Lambda Function for SOAP / REST Conversion

I have a legacy application which currently utilises a SOAP interface to invoke functions against.

I wish to serve this interface to a website, with it being preferential to be done using REST with a JSON scheme.

I wish to get feedback and validate my thinking for the solution to this problem as described below:

In order to do the transformation from SOAP (XML) <--> REST (JSON) I am planning on using the following components:

A few questions:

  1. I am unsure whether it is the Lambda function which carries out the request directly to my SOAP service, I am assuming so as this is just an encapsulated function. Is this correct?

  2. Does the Lambda function return the response back to the gateway request? I believe this is correct as the function can execute synchronously so will still have the context to return the response back.

  3. Do you generally handle any authentication checks within the API Gateway for the initial inbound request or does the request in its entirety get passed down to the Lambda function where I would then conduct and execute any auth policies/checks?

Upvotes: 3

Views: 12576

Answers (1)

Ashan
Ashan

Reputation: 19728

For Question 1 & 2: Yes, it is correct to do the SOAP request and transformation in the Lambda function.

For Question 3: To handle authentication at API Gateway, you can use a separate Lambda function called Custom Authorizer. You can also do authorization for API Gateway endpoints in Custom Authorizer Lambda function.

Upvotes: 6

Related Questions