From: <sa...@us...> - 2006-11-06 04:02:59
|
Revision: 1295 http://svn.sourceforge.net/pywebsvcs/?rev=1295&view=rev Author: sanxiyn Date: 2006-11-05 20:02:53 -0800 (Sun, 05 Nov 2006) Log Message: ----------- Update fpconst location Modified Paths: -------------- trunk/SOAPpy/README trunk/SOAPpy/RELEASE_INFO Modified: trunk/SOAPpy/README =================================================================== --- trunk/SOAPpy/README 2006-11-06 03:57:39 UTC (rev 1294) +++ trunk/SOAPpy/README 2006-11-06 04:02:53 UTC (rev 1295) @@ -113,8 +113,8 @@ REQUIRED PACKAGES: ----------------- - - fpconst 0.6.0 or later, - <http://research.warnes.net/projects/RStatServer/fpconst/> + - fpconst 0.6.0 or later, available from PyPI: + <http://www.python.org/pypi/fpconst> - pyXML 0.8.3 or later, <http://pyxml.sourceforge.net> Modified: trunk/SOAPpy/RELEASE_INFO =================================================================== --- trunk/SOAPpy/RELEASE_INFO 2006-11-06 03:57:39 UTC (rev 1294) +++ trunk/SOAPpy/RELEASE_INFO 2006-11-06 04:02:53 UTC (rev 1295) @@ -265,8 +265,8 @@ -------------- - Removed import of obsoleted ieee753.py. Now use the fpconst module - proposed by PEP 754, available from - <http://research.warnes.net/projects/RStatServer/fpconst/> + proposed by PEP 754, available from + <http://www.python.org/pypi/fpconst> - SOAPpy should no longer depend on pyXML. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-05 06:43:29
|
Revision: 1303 http://svn.sourceforge.net/pywebsvcs/?rev=1303&view=rev Author: sanxiyn Date: 2006-12-04 22:43:29 -0800 (Mon, 04 Dec 2006) Log Message: ----------- Fix #1455495 with a test Modified Paths: -------------- trunk/SOAPpy/SOAPpy/Parser.py trunk/SOAPpy/tests/SOAPtest.py Modified: trunk/SOAPpy/SOAPpy/Parser.py =================================================================== --- trunk/SOAPpy/SOAPpy/Parser.py 2006-12-05 05:47:38 UTC (rev 1302) +++ trunk/SOAPpy/SOAPpy/Parser.py 2006-12-05 06:43:29 UTC (rev 1303) @@ -869,9 +869,9 @@ if t[1] == "boolean": d = d.strip().lower() if d in ('0', 'false'): - return 0 + return False if d in ('1', 'true'): - return 1 + return True raise AttributeError, "invalid boolean value" if t[1] in ('double','float'): l = self.floatlimits[t[1]] Modified: trunk/SOAPpy/tests/SOAPtest.py =================================================================== --- trunk/SOAPpy/tests/SOAPtest.py 2006-12-05 05:47:38 UTC (rev 1302) +++ trunk/SOAPpy/tests/SOAPtest.py 2006-12-05 06:43:29 UTC (rev 1303) @@ -706,6 +706,13 @@ self.assertEquals(s.param2, None) self.assertEquals(s.param3, 7) + def testBoolean2(self): + x = True + y = buildSOAP(x) + z = parseSOAPRPC(y) + self.assertEquals(x, z) + self.assertEquals(type(z), bool) + def testFault(self): my_xml5 = ''' <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2008-05-15 17:02:07
|
Revision: 1453 http://pywebsvcs.svn.sourceforge.net/pywebsvcs/?rev=1453&view=rev Author: warnes Date: 2008-05-15 10:02:00 -0700 (Thu, 15 May 2008) Log Message: ----------- Fix error handling when an unexpected tag is encounterd outside the SOAP body. Modified Paths: -------------- trunk/SOAPpy/SOAPpy/Parser.py trunk/SOAPpy/tests/Bug1161780.py trunk/SOAPpy/tests/Makefile Modified: trunk/SOAPpy/SOAPpy/Parser.py =================================================================== --- trunk/SOAPpy/SOAPpy/Parser.py 2008-05-14 21:36:32 UTC (rev 1452) +++ trunk/SOAPpy/SOAPpy/Parser.py 2008-05-15 17:02:00 UTC (rev 1453) @@ -85,6 +85,16 @@ self._rules = rules def startElementNS(self, name, qname, attrs): + + def toStr( name ): + prefix = name[0] + tag = name[1] + if self._prem_r.has_key(prefix): + tag = self._prem_r[name[0]] + ':' + name[1] + elif prefix: + tag = prefix + ":" + tag + return tag + # Workaround two sax bugs if name[0] == None and name[1][0] == ' ': name = (None, name[1][1:]) @@ -95,8 +105,8 @@ if self._next == "E": if name[1] != 'Envelope': - raise Error, "expected `SOAP-ENV:Envelope', gto `%s:%s'" % \ - (self._prem_r[name[0]], name[1]) + raise Error, "expected `SOAP-ENV:Envelope', " \ + "got `%s'" % toStr( name ) if name[0] != NS.ENV: raise faultType, ("%s:VersionMismatch" % NS.ENV_T, "Don't understand version `%s' Envelope" % name[0]) @@ -108,16 +118,17 @@ else: raise Error, \ "expected `SOAP-ENV:Header' or `SOAP-ENV:Body', " \ - "got `%s'" % self._prem_r[name[0]] + ':' + name[1] + "got `%s'" % toStr( name ) elif self._next == "B": if name == (NS.ENV, "Body"): self._next = None else: - raise Error, "expected `SOAP-ENV:Body', got `%s'" % \ - self._prem_r[name[0]] + ':' + name[1] + raise Error, "expected `SOAP-ENV:Body', " \ + "got `%s'" % toStr( name ) elif self._next == "": - raise Error, "expected nothing, got `%s'" % \ - self._prem_r[name[0]] + ':' + name[1] + raise Error, "expected nothing, " \ + "got `%s'" % toStr( name ) + if len(self._stack) == 2: rules = self._rules Modified: trunk/SOAPpy/tests/Bug1161780.py =================================================================== --- trunk/SOAPpy/tests/Bug1161780.py 2008-05-14 21:36:32 UTC (rev 1452) +++ trunk/SOAPpy/tests/Bug1161780.py 2008-05-15 17:02:00 UTC (rev 1453) @@ -1,9 +1,10 @@ #!/usr/bin/env python import sys -sys.path = ["/home/tim/SOAPpy-0.12.0"] \ - + sys.path +sys.path.insert(1, "..") +from SOAPpy.Errors import Error from SOAPpy.Parser import parseSOAPRPC -bad = """<?xml version="1.0"?> + +original = """<?xml version="1.0"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" @@ -15,4 +16,13 @@ <ErrorString>The CustomerID tag could not be found or the number contained in the tag was invalid</ErrorString></SOAP-ENV:Envelope> """ -parseSOAPRPC(bad, attrs = 1) + +try: + parseSOAPRPC(original, attrs = 1) +except Error, e: + if e.msg != "expected nothing, got `ErrorString'": + raise AssertionError, "Incorrect error message generated: " + e.msg +else: + raise AssertionError, "Incorrect error message generated" + +print "Success" Modified: trunk/SOAPpy/tests/Makefile =================================================================== --- trunk/SOAPpy/tests/Makefile 2008-05-14 21:36:32 UTC (rev 1452) +++ trunk/SOAPpy/tests/Makefile 2008-05-15 17:02:00 UTC (rev 1453) @@ -1,9 +1,11 @@ PYTHON=python -default: echoClient echoHeader largeDataTest Bug1001646 Bug916265 \ +default: echoClient echoHeader largeDataTest bugs \ card independent \ testClient1 outside_services +bugs: Bug1001646 Bug916265 Bug1161780 + echoClient: $(PYTHON) echoServer.py >& echoServer_echoClient.log & sleep 5s # wait for server to start up @@ -29,6 +31,9 @@ $(PYTHON) esj_test_client.py +Bug1161780: + $(PYTHON) Bug1161780.py + Bug1001646: $(PYTHON) echoServer.py >& echoServer_largeDataTest.log & sleep 5s # wait for server to start up @@ -50,7 +55,7 @@ independent: $(PYTHON) speedTest.py $(PYTHON) Bug918216.py - $(PYTHON) ComplexTypes.py + -$(PYTHON) ComplexTypes.py -$(PYTHON) SOAPtest.py # one subtest will fail $(PYTHON) TCtest.py $(PYTHON) testleak.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2008-05-15 18:53:09
|
Revision: 1456 http://pywebsvcs.svn.sourceforge.net/pywebsvcs/?rev=1456&view=rev Author: warnes Date: 2008-05-15 11:53:06 -0700 (Thu, 15 May 2008) Log Message: ----------- Fix handling of boolean arrays, bug #1936883 Modified Paths: -------------- trunk/SOAPpy/SOAPpy/Parser.py trunk/SOAPpy/tests/Makefile Modified: trunk/SOAPpy/SOAPpy/Parser.py =================================================================== --- trunk/SOAPpy/SOAPpy/Parser.py 2008-05-15 17:20:09 UTC (rev 1455) +++ trunk/SOAPpy/SOAPpy/Parser.py 2008-05-15 18:53:06 UTC (rev 1456) @@ -855,7 +855,7 @@ #print " data=", d if t[0] in NS.EXSD_L: - if t[1] == "integer": + if t[1] in ["int", "integer"]: try: d = int(d) if len(attrs): @@ -883,7 +883,7 @@ return str(dnn) except: return dnn - if t[1] == "boolean": + if t[1] in ["bool", "boolean"]: d = d.strip().lower() if d in ('0', 'false'): return False Modified: trunk/SOAPpy/tests/Makefile =================================================================== --- trunk/SOAPpy/tests/Makefile 2008-05-15 17:20:09 UTC (rev 1455) +++ trunk/SOAPpy/tests/Makefile 2008-05-15 18:53:06 UTC (rev 1456) @@ -4,7 +4,7 @@ card independent \ testClient1 outside_services -bugs: Bug1001646 Bug916265 Bug1161780 +bugs: Bug1001646 Bug916265 Bug1161780 Bug1936883 echoClient: $(PYTHON) echoServer.py >& echoServer_echoClient.log & @@ -31,6 +31,9 @@ $(PYTHON) esj_test_client.py +Bug1936883: + $(PYTHON) Bug1936883.py + Bug1161780: $(PYTHON) Bug1161780.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2008-05-16 23:32:45
|
Revision: 1467 http://pywebsvcs.svn.sourceforge.net/pywebsvcs/?rev=1467&view=rev Author: warnes Date: 2008-05-16 16:32:51 -0700 (Fri, 16 May 2008) Log Message: ----------- Improve error reporting in WSDL proxy. Modified Paths: -------------- trunk/SOAPpy/SOAPpy/WSDL.py trunk/SOAPpy/tests/Makefile Removed Paths: ------------- trunk/SOAPpy/tests/translateTest.py Modified: trunk/SOAPpy/SOAPpy/WSDL.py =================================================================== --- trunk/SOAPpy/SOAPpy/WSDL.py 2008-05-16 22:02:05 UTC (rev 1466) +++ trunk/SOAPpy/SOAPpy/WSDL.py 2008-05-16 23:32:51 UTC (rev 1467) @@ -6,6 +6,8 @@ from version import __version__ import wstools +import xml +from Errors import Error from Client import SOAPProxy, SOAPAddress from Config import Config import urllib @@ -39,8 +41,15 @@ # From Mark Pilgrim's "Dive Into Python" toolkit.py--open anything. if self.wsdl is None and hasattr(wsdlsource, "read"): - #print 'stream' - self.wsdl = reader.loadFromStream(wsdlsource) + print 'stream:', wsdlsource + try: + self.wsdl = reader.loadFromStream(wsdlsource) + except xml.parsers.expat.ExpatError, e: + newstream = urllib.urlopen(wsdlsource) + buf = newstream.readlines() + raise Error, "Unable to parse WSDL file at %s: \n\t%s" % \ + (wsdlsource, "\t".join(buf)) + # NOT TESTED (as of April 17, 2003) #if self.wsdl is None and wsdlsource == '-': @@ -53,15 +62,24 @@ file(wsdlsource) self.wsdl = reader.loadFromFile(wsdlsource) #print 'file' - except (IOError, OSError): - pass - + except (IOError, OSError): pass + except xml.parsers.expat.ExpatError, e: + newstream = urllib.urlopen(wsdlsource) + buf = newstream.readlines() + raise Error, "Unable to parse WSDL file at %s: \n\t%s" % \ + (wsdlsource, "\t".join(buf)) + if self.wsdl is None: try: stream = urllib.urlopen(wsdlsource) self.wsdl = reader.loadFromStream(stream, wsdlsource) except (IOError, OSError): pass - + except xml.parsers.expat.ExpatError, e: + newstream = urllib.urlopen(wsdlsource) + buf = newstream.readlines() + raise Error, "Unable to parse WSDL file at %s: \n\t%s" % \ + (wsdlsource, "\t".join(buf)) + if self.wsdl is None: import StringIO self.wsdl = reader.loadFromString(str(wsdlsource)) Modified: trunk/SOAPpy/tests/Makefile =================================================================== --- trunk/SOAPpy/tests/Makefile 2008-05-16 22:02:05 UTC (rev 1466) +++ trunk/SOAPpy/tests/Makefile 2008-05-16 23:32:51 UTC (rev 1467) @@ -62,10 +62,10 @@ -$(PYTHON) SOAPtest.py # one subtest will fail $(PYTHON) TCtest.py $(PYTHON) testleak.py - $(PYTHON) translateTest.py - $(PYTHON) weatherTest.py - $(PYTHON) whoisTest.py - $(PYTHON) xmethods.py + -$(PYTHON) translateTest.py + -$(PYTHON) weatherTest.py + -$(PYTHON) whoisTest.py + -$(PYTHON) xmethods.py $(PYTHON) ZeroLengthArray.py testClient1: Deleted: trunk/SOAPpy/tests/translateTest.py =================================================================== --- trunk/SOAPpy/tests/translateTest.py 2008-05-16 22:02:05 UTC (rev 1466) +++ trunk/SOAPpy/tests/translateTest.py 2008-05-16 23:32:51 UTC (rev 1467) @@ -1,54 +0,0 @@ -#!/usr/bin/env python - -# Copyright (c) 2001 actzero, inc. All rights reserved. -ident = '$Id$' - -import os, re -import sys -sys.path.insert(1, "..") - -from SOAPpy import * - -# Check for a web proxy definition in environment -try: - proxy_url=os.environ['http_proxy'] - phost, pport = re.search('http://([^:]+):([0-9]+)', proxy_url).group(1,2) - proxy = "%s:%s" % (phost, pport) -except: - proxy = None - - -if 1: - - server = WSDL.Proxy('http://www.webservicex.com/TranslateService.asmx?WSDL', - http_proxy=proxy, - ns="http://www.webservicex.com/") - - print server.show_methods() - - server.soapproxy.config.dumpHeadersOut = True - server.soapproxy.config.dumpSOAPOut = True - - server.soapproxy.config.dumpSOAPIn = True - server.soapproxy.config.dumpHeadersIn = True - - - -else: - - server = SOAPProxy("http://www.webservicex.net/TranslateService.asmx/", - http_proxy=proxy, - soapaction="http://www.webservicex.net/Translate") - - server.config.dumpHeadersOut = True - server.config.dumpSOAPOut = True - - server.config.dumpSOAPIn = True - server.config.dumpHeadersIn = True - -query = server.Translate(LanguageMode="EnglishToFrench", - Text="Hello, how are you today?") - -print query - -print repr(query) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |