Ask Your Question
1

How can I save the operation from a WSDL file in Python's suds to a file?

asked 2022-12-28 11:00:00 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-04-20 13:00:00 +0000

nofretete gravatar image

You can save the operation from a WSDL file in Python's suds to a file using the following steps:

  1. Import the suds.client and os modules:

    from suds.client import Client
    import os
    
  2. Create a client object from the WSDL file:

    url = 'http://example.com/service.wsdl'
    client = Client(url)
    
  3. Get the operation you want to save:

    operation = client.service.MyOperation
    
  4. Save the operation to a file:

    with open('operation.xml', 'w') as f:
       f.write(str(operation))
    

    This will save the operation to a file named "operation.xml" in the current directory.

Note: If the operation contains non-ASCII characters, you may need to encode it using the appropriate encoding.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-12-28 11:00:00 +0000

Seen: 20 times

Last updated: Apr 20 '21