473,387 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How do I access avariable named "return"?

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
2 1276
> 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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: gambler | last post by:
let's say you have: var games = new Array(); games = new GAME(gameNum, rotNum1, rotNum2, ... ); ( so a sparsley populate array which enables me to locate a game usin the game number...
3
by: ~TheIcemanCometh~ | last post by:
I have a textbox field on a report that shows an Address. The field is built up in code when the user selects the customer in the following manner: ShipAddress = CustomerName & vbCR &...
32
by: Mike Machuidel | last post by:
Hi, I'm a game developer programming mostly in C and ASM for about 7 years. Today at work a colleague (a C++ programmer) yelled at me I'm a bad C programmer because I use "return(0);" instead...
32
by: Axel Bock | last post by:
Hi all, I am trying to get my head around what happens if I return a class object from a function. It seems C++ (MinGW) does not invoke the copy constructor if I do something like this: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.