Python Zeep library designed to work with SOAP - services. Zeep is a pure-python module. However the lxml dependency does contain C code since it uses libxml2 and libxslt.
So the Zeep library can not be deployed into the Lambda Layer without some tricks. In one of my Serverless projects, I needed to use this library, and I found such a way to deploy it into the Layer:
First, as usual, create a directory:
Paste in the folder this version of the lxml library: https://github.com/BedrosovaYulia/aws-lambda-lxml/tree/master/3.8.0/py36/lxml (this version does not use libxml2 and libxslt) Now we can pack the pyton folder in a zip archive, upload it to Lambda Layer and work with SOAP. For example, we can get information about post tracking number from the Russian Post service: It works!
So the Zeep library can not be deployed into the Lambda Layer without some tricks. In one of my Serverless projects, I needed to use this library, and I found such a way to deploy it into the Layer:
First, as usual, create a directory:
mkdir -p python/lib/python3.6/site-packages/Install Zeep via pip there:
pip install zeep --target python/lib/python3.6/site-packages/The library with the dependencies will be installed in this directory. Go there and delete the lxml library folders:
Paste in the folder this version of the lxml library: https://github.com/BedrosovaYulia/aws-lambda-lxml/tree/master/3.8.0/py36/lxml (this version does not use libxml2 and libxslt) Now we can pack the pyton folder in a zip archive, upload it to Lambda Layer and work with SOAP. For example, we can get information about post tracking number from the Russian Post service: It works!
i really appreciate this work. I was looking for this solution a couple of hours. Thank you so much
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteIm thankful for the blog post.Really looking forward to read more. Will read on
ReplyDeleteaws online training
r programming online training