Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.