I have the following code:
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
from suds.client import Client
url = 'https://webpay3gint.transbank.cl/WSWebpayTransaction/cxf/WSWebpayService?wsdl'
client = Client(url)
print client
Which produces the following output:
Service ( WSWebpayServiceImplService ) tns="http://service.wswebpay.webpay.transbank.com/"
Prefixes (1)
ns0 = "http://service.wswebpay.webpay.transbank.com/"
Ports (1):
(WSWebpayServiceImplPort)
Methods (3):
acknowledgeTransaction(xs:string tokenInput, )
getTransactionResult(xs:string tokenInput, )
initTransaction(wsInitTransactionInput wsInitTransactionInput, )
Types (14):
acknowledgeTransaction
acknowledgeTransactionResponse
cardDetail
getTransactionResult
getTransactionResultResponse
initTransaction
initTransactionResponse
transactionResultOutput
wpmDetailInput
wsInitTransactionInput
wsInitTransactionOutput
wsTransactionDetail
wsTransactionDetailOutput
wsTransactionType
As you can see, some methods (initTransaction) use custom types (wsInitTransactionInput), how can I create an element of that custom type so I'm able to call initTransaction()?
The solution was to write:
object = client.factory.create('wsInitTransactionInput')
client.service.initTransaction(object)
And it was in the suds documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With