SOAPpy SOAP and/or WSDL Question
Hi all, I am relatively weak in Python and I need some help with this. I have built a series of SOAP client functions that ping, authenticate (password username), and query a SOAP server. All works well but I cannt figure out on part of the download SOAP outgoing message. I also tried WSDL and cann't figure it out. The problem: there is one element called: u'documents' whos type is: (u'http://www.ExchangeNetwork.net/schema/v1.0/node.xsd', u'ArrayOfNodeDocument') I don't know how to make an "ArrayOfNodeDocument" for an element "document". I have tried everything I can think of but I didn't have any luck. Tried to send a variable with the SOAP message as the variable but the httplib method I used gave me an error: "gaierror: (11001, 'getaddrinfo failed')". Does anyone know how to deal with this? I would appreciate some code if possible. P.S. I don't know XML-RPC Cheers, -- http://mail.python.org/mailman/listinfo/python-list
Newbie needs help extracting data from XML
Hi, Im a Python newbie and am trying to get the data out of a series of XML files. So for example the xml is: http://schemas.xmlsoap.org/soap/envelope/"; xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:tns="http://www.ExchangeNetwork.net/schema/v1.0/node.wsdl"; xmlns:types="http://www.ExchangeNetwork.net/schema/v1.0/node.wsdl"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";>http://schemas.xmlsoap.org/ws/2002/07/utility";>2005-12-28T05:59:38Z2005-12-28T06:04:38Zhttp://schemas.xmlsoap.org/soap/encoding/";>http://www.ExchangeNetwork.net/schema/v1.0/node.xsd";>Ready and I want to get the value from the element "return" which currently has a value of "Ready". Other XML files I want to work with may have several elements I want to pull data from. This seem relatively easy but I have been reading and cruising google for hours and none of the examples make any sense. I appreciate any code writing help with this. -- http://mail.python.org/mailman/listinfo/python-list
Re: Newbie needs help extracting data from XML
Thanks for the help This was a SOAP Webservice message. I used httplib instead of SOAPpy or ZSI because SOAPpy cann't do arrays of complex type and ZSI was confusing. Thanks again "Rodney" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > Im a Python newbie and am trying to get the data out of a series of XML > files. So for example the xml is: > > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; > xmlns:tns="http://www.ExchangeNetwork.net/schema/v1.0/node.wsdl"; > xmlns:types="http://www.ExchangeNetwork.net/schema/v1.0/node.wsdl"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xmlns:xsd="http://www.w3.org/2001/XMLSchema";> xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility";>2005-12-28T05:59:38Z2005-12-28T06:04:38Z > soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";> > xmlns:q1="http://www.ExchangeNetwork.net/schema/v1.0/node.xsd";> xsi:type="xsd:string">Ready > > > and I want to get the value from the element "return" which currently has > a value of "Ready". > > Other XML files I want to work with may have several elements I want to > pull data from. This seem relatively easy but I have been reading and > cruising google for hours and none of the examples make any sense. > > I appreciate any code writing help with this. > > > -- http://mail.python.org/mailman/listinfo/python-list
Newbie - SOAP return message with embedded ZIP file
Hi again, thanks for the help with figuring out how to parse a SOAP return message. I know have a return message that has an embedded ZIP file in it. Can anyone help me figure out how to extract this file from the SOAP return message. The message looks as following: '\x0c \x00\x00\x00)\x00)\x00\x00\x05Xuuid:42bd2573-8c94-4b7c-9bd6-a1e29856f751\x00\x00\x00http://schemas.xmlsoap.org/soap/envelope/\x00\x00\x00http://schemas.xmlsoap.org/soap/envelope/"; xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:tns="http://www.ExchangeNetwork.net/schema/v1.0/node.wsdl"; xmlns:types="http://www.ExchangeNetwork.net/schema/v1.0/node.wsdl"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";>http://schemas.xmlsoap.org/ws/2002/07/utility";>2005-12-30T00:41:54Z2005-12-30T00:46:54Zhttp://schemas.xmlsoap.org/soap/encoding/";>http://www.ExchangeNetwork.net/schema/v1.0/node.xsd";>http://www.ExchangeNetwork.net/schema/v1.0/node.xsd"; soapenc:arrayType="q2:NodeDocument[1]">http://www.ExchangeNetwork.net/schema/v1.0/node.xsd";>3c613fde-2b1e-46dd-a60e-3c8323517eb0.zipapplication/x-zip-compressedhttp://xml.apache.org/xml-soap"; />\n\x10\x00\x00\x00$\x00\x18\x00\x00\x07\ MESSAGE CONTINUES AS ABOVE AND ENDS WITH THE FOLLOWING: -2b1e-46dd-a60e-3c8323517eb0.xmlPK\x05\x06\x00\x00\x00\x00\x01\x00\x01\x00V\x00\x00\x00I\x07\x00\x00\x00\x00\x00\x00\x00' Sorry for being so helpless on this. Thanks for any help you can give. -- http://mail.python.org/mailman/listinfo/python-list
Re: Newbie - SOAP return message with embedded ZIP file
I actually tried both SOAPpy and ZSI but both return a error message with the incoming SOAP message that basicly said it was not a proper SOAP message. "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Rodney schrieb: >> Hi again, thanks for the help with figuring out how to parse a SOAP >> return message. I know have a return message that has an embedded ZIP >> file in it. Can anyone help me figure out how to extract this file from >> the SOAP return message. The message looks as following: > > You've been told before, you'd be told it again and again: use SOAPpy or > ZSI to dela with webservices. Then you don't have to bother, yoou just > _get_ the ZIP-File (as string of course) > > > Regards, > > Diez -- http://mail.python.org/mailman/listinfo/python-list
new python contracts library
Hey I recently created a contracts library for python and was wondering if anyone finds it useful or wants to have additional features added ? Feel free to open new issues on the github project. https://github.com/rlgomes/contracts This is just a v0.1 and I welcome any and all suggestions to make it into something really useful. I've found it useful for when I start putting together a few other project ideas I have and want to make sure that the certain functions are being used correctly and that bad arguments or return values don't end up blowing up the application in a completely unrelated function call sometime later than the original point where the bug actually occurred. If this is not the correct forum for this posting let me know and i'll move it elsewhere. -- http://mail.python.org/mailman/listinfo/python-list
SOAP - Beginner Desperately looking for Help
Hi All,
I am a relative beginner to Python and am looking for help with sending and
XML message and getting back a return file. The server is:
https://node.deq.state.or.us/node/node.asmx
I have have successfully sent and recieved using the PING, AUTHENTICATE
(send in username and password and return a secuirity token), SOLICIT(send
in information for a query and get a number indicating the query),
GETSTATUS(status of query) using SOAPpy. I am using Python 2.4 on a Window
XP machine.
What I want to do now is download the result of my query using the DOWNLOAD
method. However, I cann't figure out how to do this. I have tried SOAPpy
and httplib and I cann't send the correct XML outgoing message. Any help
with this would be greatly appreciated. Following is the needed outgoing
XML file and my successful SOAPpy code.
Thank you,
Rodney ([EMAIL PROTECTED])
POST /node/node.asmx HTTP/1.1
Host: node.deq.state.or.us
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: ""
http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:tns="http://www.ExchangeNetwork.net/schema/v1.0/node.wsdl";
xmlns:types="http://www.ExchangeNetwork.net/schema/v1.0/node.wsdl/encodedTypes";
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
http://schemas.xmlsoap.org/soap/encoding/";>
http://www.ExchangeNetwork.net/schema/v1.0/node.xsd";>
string
string
string
http://www.ExchangeNetwork.net/schema/v1.0/node.xsd";
soapenc:arrayType="q1:NodeDocument[2]">
http://www.ExchangeNetwork.net/schema/v1.0/node.xsd";>
string
string
http://www.ExchangeNetwork.net/schema/v1.0/node.xsd";>
string
string
Below is an example of the code that does work.
urlNode = 'https://node.deq.state.or.us/node/node.asmx?op=NodePing'
namespace = 'http://www.ExchangeNetwork.net/schema/v1.0/node.xsd'
server = SOAPProxy(urlNode, namespace)
PING = server.NodePing('Ping')
urlAuth = 'https://node.deq.state.or.us/node/node.asmx?op=Authenticate'
# AUTHENTICATE - Returns a variable with the token
server = SOAPProxy(urlAuth, namespace)
token = server.Authenticate(userId='MYUSERNAME', credential='MYPASSWORD',
authenticationMethod='Invoke')
print token
urlSolicit = 'https://node.deq.state.or.us/node/node.asmx?op=Solicit'
server = SOAPProxy(urlSolicit, namespace)
rowID='0'
maxRows='1000'
service='GetAirMeasurements'
fieldEventStartDate='2005-01-01'
fieldEventEndDate='2005-02-01'
analyteName='PM10'
parameters=[rowID,maxRows,'','','','','','','','','','','','','','','',fieldEventStartDate,fieldEventEndDate,'',analyteName]
transID = server.Solicit(securityToken = token, returnURL = '', request =
'GetAirMeasurements', parameters = parameters)
print transID
--
http://mail.python.org/mailman/listinfo/python-list
Re: SOAP - Beginner Desperately looking for Help
Thanks :-) "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> I wanted to attach these - however, taht didn't work for NNTP, so I mail >> them to you. > > Didn't work - my mail server won't let me send these to you. So you're on > your own here. Shouldn't be too hard :) > > Diez -- http://mail.python.org/mailman/listinfo/python-list
None in string formatting
Was doing some string formatting, noticed the following: >>> x = None >>> "%s" % x 'None' Is there a reason it maps to 'None'? I had expected ''. -- http://mail.python.org/mailman/listinfo/python-list
Re: How to turn a variable name into a string?
> c = None (result of an assignment after the os.environ.get() returned a KeyError). Why not trap the KeyError? -- http://mail.python.org/mailman/listinfo/python-list
Video Catalogue
Greetz! Recently I started creating a CGI application for my gf that she would use for indexing and keeping track of her video collection. I am relatively new to python so I started with the basics. I figured out how to extract the form field values in a script and how to save to a file. My question is which data type should I use to store the information about the videos? I was thinking of using a dictionary variable, I saw something about the pickle module too, could I use it to save the state of my dictionary to a file and than later read it and feed values from it to the form fields via CGI? All help is greatly appreciated. -- http://mail.python.org/mailman/listinfo/python-list
python.exe on Mac OS X!?
I did a source code build of Python 2.4.1 on OS X (10.3.8) and the executable produced was 'python.exe'. Can someone tell me whether this is a bug, feature, or UserError? % ./configure % make % ./python.exe Python 2.4.1 (#1, Apr 17 2005, 12:14:12) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin >>> -- http://mail.python.org/mailman/listinfo/python-list
Re: python.exe on Mac OS X!?
>> executable produced was 'python.exe'. Can someone tell me whether this >> is a bug, feature, or UserError? > I'm not sure. Why don't you grab the binary? > http://www.python.org/ftp/python/2.4.1/MacPython-OSX-2.4.1-1 .dmg Because I need to keep multiple versions of Python on this machine, and as far as I can tell the binary installer overwrites the default installed version. I could be wrong. -- http://mail.python.org/mailman/listinfo/python-list
Re: python.exe on Mac OS X!?
> The default file system on MacOSX is case insensitive. As a result the .exe > extension is required to disambiguate the generated executable from the > Python directory in the source distro. OK. I got it. -- http://mail.python.org/mailman/listinfo/python-list
Why is 'None' not assignable but 'True'/'False' are?
In Python 2.4.1: >>> None = 99 SyntaxError: assignment to None >>> True = 99 >>> False = 99 >>> True == False True --- So why is 'None' special? -- http://mail.python.org/mailman/listinfo/python-list
Extended slicing and Ellipsis - where are they used?
The following are apparently legal Python syntactically: L[1:3, 8:10] L[1, ..., 5:-2] But they don't seem to work on lists: >>> l = [0,1,2,3] >>> l[0:2,3] Traceback (most recent call last): File "", line 1, in TypeError: list indices must be integers >>> l[...] Traceback (most recent call last): File "", line 1, in TypeError: list indices must be integers So where is this extended slicing used? -- Rodney -- http://mail.python.org/mailman/listinfo/python-list
Re: Extended slicing and Ellipsis - where are they used?
On Sep 13, 5:50 pm, James Stroud <[EMAIL PROTECTED]> wrote: > Rodney Maxwell wrote: > > The following are apparently legal Python syntactically: > >L[1:3, 8:10] > >L[1, ..., 5:-2] > > > But they don't seem to work on lists: > >>>> l = [0,1,2,3] > >>>> l[0:2,3] > > Traceback (most recent call last): > > File "", line 1, in > > TypeError: list indices must be integers > >>>> l[...] > > Traceback (most recent call last): > > File "", line 1, in > > TypeError: list indices must be integers > > > So where is this extended slicing used? > > AFAICT this syntax is not used in the standard library. However, the > mega-beauty of it is that you can make use of it in your own classes: > > py> class Bob(list): > ... def __getitem__(self, i): > ... try: > ... return [list.__getitem__(self, j) for j in i] > ... except TypeError: > ... return list.__getitem__(self, i) > ... > py> b = Bob(xrange(15, 30)) > py> b[3, 5, 7, 13] > [18, 20, 22, 28] > > James Or >>> b[0:3, 5, 9] [[15, 16, 17], 20, 24] which is what I was looking for in the first place. Thanks, Rodney -- http://mail.python.org/mailman/listinfo/python-list
Re: Extended slicing and Ellipsis - where are they used?
On Sep 13, 5:50 pm, James Stroud <[EMAIL PROTECTED]> wrote: > Rodney Maxwell wrote: > > The following are apparently legal Python syntactically: > >L[1:3, 8:10] > >L[1, ..., 5:-2] > > > But they don't seem to work on lists: > >>>> l = [0,1,2,3] > >>>> l[0:2,3] > > Traceback (most recent call last): > > File "", line 1, in > > TypeError: list indices must be integers > >>>> l[...] > > Traceback (most recent call last): > > File "", line 1, in > > TypeError: list indices must be integers > > > So where is this extended slicing used? > > AFAICT this syntax is not used in the standard library. However, the > mega-beauty of it is that you can make use of it in your own classes: > > py> class Bob(list): > ... def __getitem__(self, i): > ... try: > ... return [list.__getitem__(self, j) for j in i] > ... except TypeError: > ... return list.__getitem__(self, i) > ... > py> b = Bob(xrange(15, 30)) > py> b[3, 5, 7, 13] > [18, 20, 22, 28] > > James Or >>> b[0:3, 5, 9] [[15, 16, 17], 20, 24] which is what I was looking for in the first place. Thanks, Rodney -- http://mail.python.org/mailman/listinfo/python-list
