Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zeep-generator? tool for generating Python code based on a WSDL document? #1372

Open
AlexandreHGuerra opened this issue May 4, 2023 · 0 comments

Comments

@AlexandreHGuerra
Copy link

Hello, thanks for the help
Is there any code generator at all for zeep? i was doing a check about zeep fetures querying chatgpt, and the following text below appeared. is it 'hallucinating'?

question
¨
zeep is quite capable, but i would like to look after a library that would allow me to compile a WSDL structure into a python module, in order to help me avoid excessive code manipulation for data structures
"

answer
In that case, you might want to consider using python-zeep in combination with zeep-generator. python-zeep is a modern, fast and well-documented SOAP client for Python that allows you to easily consume SOAP web services. It also includes support for generating Python code from a WSDL document.

zeep-generator is a companion tool to python-zeep that can generate Python code based on a WSDL document. It generates a module that defines all the types and services specified in the WSDL, so you don't have to manually create data structures for each request and response.

Here's an example of how to use zeep-generator to generate Python code from a WSDL document:

Install zeep-generator using pip:

Copy code
pip install zeep-generator
Generate Python code from the WSDL document using zeep-generator:

arduino
Copy code
zeep-generate http://example.com/soap.wsdl -o mysoapmodule
This will generate a Python module named mysoapmodule in the current directory, containing all the types and services specified in the WSDL document.

Import the generated module and use it to interact with the SOAP service:

java
Copy code
from mysoapmodule import MyService

client = MyService()

result = client.some_method(some_param='some_value')
This will create a client object for the SOAP service and call the some_method method with the specified parameter. The response will be returned as a Python object, without you having to manually construct the data structures.

Using zeep-generator can save you a lot of time and effort, since you don't have to manually create data structures for each request and response. Instead, you can focus on using the generated code to interact with the SOAP service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant