M    ZSI/dispatch.py
M    ZSI/dispatch.py



	From: 	  ajcoon@gmail.com
	Subject: 	Re: [Pywebsvcs-talk] ZSI mod_python example
	Date: 	March 6, 2007 8:21:50 AM PST
	To: 	  pywebsvcs-talk@lists.sourceforge.net

So I figured out part of the problem.  The "inner" error was being
caused by a problem in _Dispatch where a return statement was missing
from an except block.  After the error calling the handler occurs, the
exception is caught, but processing would continue on, causing an
unintentional error.

I added return statements in front of SendFault in _Dispatch.  In my
version, this is lines 79-87:

            try:
                result = handler(arg)
            except Exception,ex:
                return SendFault(FaultFromZSIException(ex), **kw)

            try:
                tc = result.typecode
            except AttributeError,ex:
                return SendFault(FaultFromZSIException(ex), **kw)


Anyways...back to the "outer error".  Here's what the output looks
like now:


Hello:  _________________________________ Tue Mar  6 11:12:24 2007
REQUEST:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/
encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" xmlns:xsd="http://
www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/
encoding/"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body><hello></
hello></SOAP-ENV:Body></SOAP-ENV:Envelope>
_________________________________ Tue Mar  6 11:12:25 2007 RESPONSE:
200
OK
-------
Date: Tue, 06 Mar 2007 16:12:24 GMT
Server: Apache/2.0.55 (Ubuntu) mod_python/3.2.8 Python/2.4.4c1
Transfer-Encoding: chunked
Content-Type: text/xml

<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/
encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" xmlns:xsd="http://
www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body><SOAP-
ENV:Fault><faultcode>SOAP-ENV:Client</
faultcode><faultstring>Unparseable message</
faultstring><detail><Ex566deae0>&lt;ZSI:ParseFaultDetail&gt;
&lt;ZSI:string&gt;hello() takes no arguments (1 given)&lt;/
ZSI:string&gt;
&lt;ZSI:trace&gt;&lt;/ZSI:trace&gt;
&lt;/ZSI:ParseFaultDetail&gt;
</Ex566deae0></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-
ENV:Envelope>
Traceback (most recent call last):
  File "./mpclient.py", line 15, in ?
    print "Hello: ", b.hello()
  File "build/bdist.linux-i686/egg/ZSI/client.py", line 63, in
__call__
  File "build/bdist.linux-i686/egg/ZSI/client.py", line 171, in RPC
  File "build/bdist.linux-i686/egg/ZSI/client.py", line 503, in
Receive
  File "build/bdist.linux-i686/egg/ZSI/client.py", line 431, in
Receive
ZSI.FaultException: Unparseable message
<ZSI:ParseFaultDetail>
<ZSI:string>hello() takes no arguments (1 given)</ZSI:string>
<ZSI:trace></ZSI:trace>
</ZSI:ParseFaultDetail>



On Mar 5, 11:40 am, "aj" <ajc...@gmail.com> wrote:
Hello,

I am trying to get the mod_python example to work on my system, but
with no success.  I'm pretty sure that apache2 and mod_python are
installed correctly.  If it matters, I'm running python 2.4.4c1 on
Ubuntu (Edgy Eft).

Here's what I'm getting when I try to call the "hello" example:

Hello:  _________________________________ Mon Mar  5 11:39:38 2007
REQUEST:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/
encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/
encoding/"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body><hello></
hello></SOAP-ENV:Body></SOAP-ENV:Envelope>
_________________________________ Mon Mar  5 11:39:39 2007 RESPONSE:
200
OK
-------
Date: Mon, 05 Mar 2007 16:39:38 GMT
Server: Apache/2.0.55 (Ubuntu) mod_python/3.2.8 Python/2.4.4c1
Transfer-Encoding: chunked
Content-Type: text/xml

<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/
encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body><SOAP-
ENV:Fault><faultcode>SOAP-ENV:Client</
faultcode><faultstring>Unparseable message</
faultstring><detail><Ex563d2ae0>&lt;ZSI:ParseFaultDetail&gt;
&lt;ZSI:string&gt;hello() takes no arguments (1 given)&lt;/
ZSI:string&gt;
&lt;ZSI:trace&gt;&lt;/ZSI:trace&gt;
&lt;/ZSI:ParseFaultDetail&gt;
</Ex563d2ae0></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-
ENV:Envelope><SOAP-ENV:Envelope xmlns:SOAP-ENC="http://
schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://
schemas.xmlsoap.org/soap/envelope/" xmlns:ZSI="http://www.zolera.com/
schemas/ZSI/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-
ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body><SOAP-
ENV:Fault><faultcode>SOAP-ENV:Server</
faultcode><faultstring>Processing Failure</
faultstring><detail><ZSI:FaultDetail><ZSI:string>exceptions:UnboundLocalError
local variable 'result' referenced before assignment</
ZSI:string><ZSI:trace>build/bdist.linux-i686/egg/ZSI/dispatch.py:
85:_Dispatch</ZSI:trace></ZSI:FaultDetail></detail></SOAP-ENV:Fault></
SOAP-ENV:Body></SOAP-ENV:Envelope>
Traceback (most recent call last):
  File "./client.py", line 7, in ?
    print "Hello: ", b.hello()
  File "/home/aj/www/zsitest/client.py", line 63, in __call__

  File "/home/aj/www/zsitest/client.py", line 171, in RPC

  File "/home/aj/www/zsitest/client.py", line 498, in Receive

  File "/home/aj/www/zsitest/client.py", line 398, in ReceiveSOAP

  File "build/bdist.linux-i686/egg/ZSI/parse.py", line 59, in __init__
  File "/usr/lib/python2.4/site-packages/PyXML-0.8.4-py2.4-linux-
i686.egg/_xmlplus/dom/ext/reader/__init__.py", line 60, in fromString
    return self.fromStream(stream, ownerDoc)
  File "/usr/lib/python2.4/site-packages/PyXML-0.8.4-py2.4-linux-
i686.egg/_xmlplus/dom/ext/reader/PyExpat.py", line 65, in fromStream
    success = self.parser.ParseFile(stream)
xml.parsers.expat.ExpatError: junk after document element: line 5,
column 75

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cashhttp://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DE...
_______________________________________________
Pywebsvcs-talk mailing list
Pywebsvcs-t...@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/pywebsvcs-talk
Also archived athttp://groups.google.com/group/pywebsvcs


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Pywebsvcs-talk mailing list
Pywebsvcs-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pywebsvcs-talk
Also archived at http://groups.google.com/group/pywebsvcs



git-svn-id: c4afb4e777bcbfe9afa898413b708b5abcd43877@1363 7150bf37-e60d-0410-b93f-83e91ef0e581

acigna/pywez,acigna/pywez,acigna/pywez