This is AWS lambda integration for a simple SOAP server.
There are still a lot of old/legacy project which use SOAP protocol to expose their services. To grab the benefit of AWS serverless services, this is simple try to achieve this step. This project is still matuaring to support all kind of requirements from SOAP world. I will be greatful to all if you want to report an issue or want to contribute in terms of pull request.
$npm install --save soap-server-lambda
OR
$yarn add soap-server-lambda
'use strict';
/**
* Sample MyService
*/
class MyService {
/**
* Test function method
*
* @param {String} testParam
*/
async MyFunction(testParam) {
if (testParam) {
return {
status: 'Successful with param: ' + testParam,
};
}
return {
status: 'Unsuccessful',
};
}
}
module.exports = MyService;
const SoapServer = require('soap-server-lambda');
const MyService = require('/path/to/MyService');
const server = new SoapServer({
services: () => {
return {
myService: {
wsdlPath: 'wsdls/MyService.wsdl',
service: new MyService(),
},
};
},
});
exports.handler = server.createHandler({debug: true});
You have define the name of your function as same to operation name mentioned in your service WSDL file.
This project took a lot of inspiration and reference from apollo-server-lambda project.
If you are experiencing a issue or wanted to add a new feature, please create a github issue here.
⭐ Star me on GitHub — it helps!
❤️ contribution: Here is contributing guide in deatil.
For impatient here are quick steps:
- Fork the repository
- Create Branch in you local repository
- while(youFinish) { Commit }
- Squash related commits.
- Write unit test cases for your work.
- Check the Build on your local.
- Raise a Pull Request (aka PR)