How do I access avariable named "return"?

H

Holger Wirtz

Hi,

I have a small problem: I have a WSDL file where different functions are
described. It worked perfectly until I have a function which has a
return-value named "return":

Here is my program:

--- cut here ---
from SOAPpy import WSDL
wsdlFile = 'mypbx.wsdl'
server = WSDL.Proxy(wsdlFile)
version=server.Version()
#print version.GatekeeperID # Works fine
#print version.FirmwareVersion # Works also

resp=server.Initialize(user="Wirtz, Holger - DFN-Verein",appl="PySOAP")
print resp
print resp.return
--- cut here ---

When the line "print resp.return" is comented out I got:

<SOAPpy.Types.structType InitializeResponse at 1081322348>: {'return':
'221', 'key': '1424926643'}

But with the "print resp.return" I got:

File "pywsdl.py", line 10
print resp.return
^
SyntaxError: invalid syntax

I think this seems to be a problem due to the use of a forbidden word. But I
have no chance to change the WSDL definition, so: How can I get the
variable resp.return? Any suggestions?

Thanks, Holger
 
B

Brian Beck

I think this seems to be a problem due to the use of a forbidden word. But I
have no chance to change the WSDL definition, so: How can I get the
variable resp.return? Any suggestions?

To get it: getattr(resp, 'return')
To set it: setattr(resp, 'return', value)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top