By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,941 Members | 1,753 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,941 IT Pros & Developers. It's quick & easy.

How do I access avariable named "return"?

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
> 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)

--
Brian Beck
Adventurer of the First Order

Jul 19 '05 #2

P: n/a
Brian Beck wrote:
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)

--
Brian Beck
Adventurer of the First Order


Ahhh! That's it! Thanks a lot!!!

Holger

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.