Problems with Web2PY gateway

View: New views
5 Messages — Rating Filter:   Alert me  

Problems with Web2PY gateway

by rpb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Nick! A happy new year to all!

Thanks for taking a look, sadly, I still have problems with the Gateway
for Web2Py(formely known as Gluon http://mdp.cti.depaul.edu/) I have
used Charles and ServiceCapture to try to debug things to no avail
because I sometimes receive no errors or this traceback:


1. Traceback (most recent call last):
 2.   File "E:\_install\_install_programm
ing\gluon_src\gluon\gluon\restricted.py",
line 66, in restricted
 3.     exec ccode in environment
 4.   File "applications/pyamf/controllers/default.py", line 24, in
<module>
 5.   File "applications/pyamf/controllers/default.py", line 16, in gateway
 6.     pyamf_request = pyamf.remoting.decode(request.body, context)
 7.   File "build\bdist.win32\egg\pyamf
\remoting\__init__.py", line
474, in decode
 8.   File "build\bdist.win32\egg\pyamf\util.py", line 151, in read_uchar
 9.     return struct.unpack("!B", self._read(1))[0]
10.   File "build\bdist.win32\egg\pyamf\util.py", line 141, in _read
11.     bytes = self.read(length)
12.   File "build\bdist.win32\egg\pyamf\util.py", line 275, in read
13.     raise EOFError
14. EOFError

Do you have any other ideas what might be going wrong here?


Nick Joyce wrote:

> Hey akira,
>
> The gateway code looks good, but I haven't done any specific testing (I'm
> also not that familiar with Gluon). Are there any error messages being
> generated by Flash? I would suggest that you use the PyAMF client to
> determine what's being sent etc. Also using an http proxy like Charles
> (http://www.xk72.com/charles/) to see whats being sent/received comes in
> very handy.
>
> Hope this helps.
>
> Cheers,
>
> Nick
>
> On Sun, December 30, 2007 9:17 pm, akira wrote:
>  
>> Hi guys! I hope you all had a nice christmas. I am still trying to get
>> Pyamf to work with Gluon(http://mdp.cti.depaul.edu/). The flash file Im
>> using works with the WSGI gateway with Pylons.  This is what my code
>> looks
>> like in Gluon, is there anything tat I did wrong or forgot?
>>
>> import pyamf import pyamf.remoting.gateway
>>
>> ### services you want to expose via pyamf gateway...
>>
>>
>> def echo(data): print "this is the echo service" return data
>>
>> services={'echo.echo':echo}
>>
>>
>> ### here is the Gluon gateway should be the equivalent to DjangoGateway
>>
>>
>> def gateway(): print "gateway func called" base_gateway =
>> pyamf.remoting.gateway.BaseGateway(services) context =
>> pyamf.get_context(pyamf.AMF0) if not request.body:
>> request.body=request.env.wsgi_input.read() pyamf_request =
>> pyamf.remoting.decode(request.body, context) pyamf_response =
>> pyamf.remoting.Envelope(pyamf_request.amfVersion, \
>>
>> pyamf_request.clientType) for name, message in pyamf_request:
>> pyamf_response[name] = base_gateway.getProcessor(message)(message)
>> response.headers['Content-Type'] = pyamf.remoting.CONTENT_TYPE return
>> pyamf.remoting.encode(pyamf_response, context).getvalue()
>>
>>
>> Thanks in advance!
>> _______________________________________________
>> PyAMF dev mailing list - dev@...
>> http://lists.pyamf.org/mailman/listinfo/dev
>>
>>
>>    
>
>
> _______________________________________________
> PyAMF dev mailing list - dev@...
> http://lists.pyamf.org/mailman/listinfo/dev
>
>  



Re: Problems with Web2PY gateway

by Nick Joyce :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, January 9, 2008 6:28 pm, akira wrote:
> Hi Nick! A happy new year to all!

And to you!

>
> Thanks for taking a look, sadly, I still have problems with the Gateway
> for Web2Py(formely known as Gluon http://mdp.cti.depaul.edu/) I have used
> Charles and ServiceCapture to try to debug things to no avail
> because I sometimes receive no errors or this traceback:

Can you package up everything under applications/pyamf/ and then post them
here? I can then go through with what you've got and hopefully work out
what is causing you problems ..

Thanks,

Nick

>
>
> 1. Traceback (most recent call last):
> 2.   File "E:\_install\_install_programm
> ing\gluon_src\gluon\gluon\restricted.py", line 66, in restricted 3.    
exec

> ccode in environment 4.   File
> "applications/pyamf/controllers/default.py", line 24, in
> <module>
> 5.   File "applications/pyamf/controllers/default.py", line 16, in gateway
>  6.     pyamf_request = pyamf.remoting.decode(request.body, context)
> 7.   File "build\bdist.win32\egg\pyamf
> \remoting\__init__.py", line
> 474, in decode
> 8.   File "build\bdist.win32\egg\pyamf\util.py", line 151, in read_uchar
> 9.     return struct.unpack("!B", self._read(1))[0]
> 10.   File "build\bdist.win32\egg\pyamf\util.py", line 141, in _read
> 11.     bytes = self.read(length)
> 12.   File "build\bdist.win32\egg\pyamf\util.py", line 275, in read
> 13.     raise EOFError
> 14. EOFError
>
>
> Do you have any other ideas what might be going wrong here?
>
>
>
> Nick Joyce wrote:
>
>> Hey akira,
>>
>>
>> The gateway code looks good, but I haven't done any specific testing
>> (I'm
>> also not that familiar with Gluon). Are there any error messages being
>> generated by Flash? I would suggest that you use the PyAMF client to
>> determine what's being sent etc. Also using an http proxy like Charles
>> (http://www.xk72.com/charles/) to see whats being sent/received comes
>> in very handy.
>>
>> Hope this helps.
>>
>>
>> Cheers,
>>
>>
>> Nick
>>
>>
>> On Sun, December 30, 2007 9:17 pm, akira wrote:
>>
>>
>>> Hi guys! I hope you all had a nice christmas. I am still trying to
>>> get Pyamf to work with Gluon(http://mdp.cti.depaul.edu/). The flash
>>> file Im using works with the WSGI gateway with Pylons.  This is what
>>> my code looks like in Gluon, is there anything tat I did wrong or
>>> forgot?
>>>
>>> import pyamf import pyamf.remoting.gateway
>>>
>>> ### services you want to expose via pyamf gateway...
>>>
>>>
>>>
>>> def echo(data): print "this is the echo service" return data
>>>
>>> services={'echo.echo':echo}
>>>
>>>
>>>
>>> ### here is the Gluon gateway should be the equivalent to
>>> DjangoGateway
>>>
>>>
>>>
>>> def gateway(): print "gateway func called" base_gateway =
>>> pyamf.remoting.gateway.BaseGateway(services) context =
>>> pyamf.get_context(pyamf.AMF0) if not request.body:
>>> request.body=request.env.wsgi_input.read() pyamf_request =
>>> pyamf.remoting.decode(request.body, context) pyamf_response =
>>> pyamf.remoting.Envelope(pyamf_request.amfVersion, \
>>>
>>> pyamf_request.clientType) for name, message in pyamf_request:
>>> pyamf_response[name] = base_gateway.getProcessor(message)(message)
>>> response.headers['Content-Type'] = pyamf.remoting.CONTENT_TYPE return
>>>  pyamf.remoting.encode(pyamf_response, context).getvalue()
>>>
>>>
>>> Thanks in advance!
>>> _______________________________________________
>>> PyAMF dev mailing list - dev@...
>>> http://lists.pyamf.org/mailman/listinfo/dev
>>>
>>>
>>>
>>>
>>
>>
>> _______________________________________________
>> PyAMF dev mailing list - dev@...
>> http://lists.pyamf.org/mailman/listinfo/dev
>>
>>
>>
>
> _______________________________________________
> PyAMF dev mailing list - dev@...
> http://lists.pyamf.org/mailman/listinfo/dev
>
>




Re: Problems with Web2PY gateway

by rpb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the offer Nick. Massimo sent me the latest Web2Py AMF gateway
today, I am happy to say that it passes all the tests :-) I would write
a few sentence on how to set things up probably in a few days. The only
thing that Massimo has problems with is the handling of malfomed
requests as in the Pylons Gateway.

Thanks

Nick Joyce wrote:

> On Wed, January 9, 2008 6:28 pm, akira wrote:
>  
>> Hi Nick! A happy new year to all!
>>    
>
> And to you!
>
>  
>> Thanks for taking a look, sadly, I still have problems with the Gateway
>> for Web2Py(formely known as Gluon http://mdp.cti.depaul.edu/) I have used
>> Charles and ServiceCapture to try to debug things to no avail
>> because I sometimes receive no errors or this traceback:
>>    
>
> Can you package up everything under applications/pyamf/ and then post them
> here? I can then go through with what you've got and hopefully work out
> what is causing you problems ..
>
> Thanks,
>
> Nick
>
>  
>> 1. Traceback (most recent call last):
>> 2.   File "E:\_install\_install_programm
>> ing\gluon_src\gluon\gluon\restricted.py", line 66, in restricted 3.    
>>    
> exec
>  
>> ccode in environment 4.   File
>> "applications/pyamf/controllers/default.py", line 24, in
>> <module>
>> 5.   File "applications/pyamf/controllers/default.py", line 16, in gateway
>>  6.     pyamf_request = pyamf.remoting.decode(request.body, context)
>> 7.   File "build\bdist.win32\egg\pyamf
>> \remoting\__init__.py", line
>> 474, in decode
>> 8.   File "build\bdist.win32\egg\pyamf\util.py", line 151, in read_uchar
>> 9.     return struct.unpack("!B", self._read(1))[0]
>> 10.   File "build\bdist.win32\egg\pyamf\util.py", line 141, in _read
>> 11.     bytes = self.read(length)
>> 12.   File "build\bdist.win32\egg\pyamf\util.py", line 275, in read
>> 13.     raise EOFError
>> 14. EOFError
>>
>>
>> Do you have any other ideas what might be going wrong here?
>>
>>
>>
>> Nick Joyce wrote:
>>
>>    
>>> Hey akira,
>>>
>>>
>>> The gateway code looks good, but I haven't done any specific testing
>>> (I'm
>>> also not that familiar with Gluon). Are there any error messages being
>>> generated by Flash? I would suggest that you use the PyAMF client to
>>> determine what's being sent etc. Also using an http proxy like Charles
>>> (http://www.xk72.com/charles/) to see whats being sent/received comes
>>> in very handy.
>>>
>>> Hope this helps.
>>>
>>>
>>> Cheers,
>>>
>>>
>>> Nick
>>>
>>>
>>> On Sun, December 30, 2007 9:17 pm, akira wrote:
>>>
>>>
>>>      
>>>> Hi guys! I hope you all had a nice christmas. I am still trying to
>>>> get Pyamf to work with Gluon(http://mdp.cti.depaul.edu/). The flash
>>>> file Im using works with the WSGI gateway with Pylons.  This is what
>>>> my code looks like in Gluon, is there anything tat I did wrong or
>>>> forgot?
>>>>
>>>> import pyamf import pyamf.remoting.gateway
>>>>
>>>> ### services you want to expose via pyamf gateway...
>>>>
>>>>
>>>>
>>>> def echo(data): print "this is the echo service" return data
>>>>
>>>> services={'echo.echo':echo}
>>>>
>>>>
>>>>
>>>> ### here is the Gluon gateway should be the equivalent to
>>>> DjangoGateway
>>>>
>>>>
>>>>
>>>> def gateway(): print "gateway func called" base_gateway =
>>>> pyamf.remoting.gateway.BaseGateway(services) context =
>>>> pyamf.get_context(pyamf.AMF0) if not request.body:
>>>> request.body=request.env.wsgi_input.read() pyamf_request =
>>>> pyamf.remoting.decode(request.body, context) pyamf_response =
>>>> pyamf.remoting.Envelope(pyamf_request.amfVersion, \
>>>>
>>>> pyamf_request.clientType) for name, message in pyamf_request:
>>>> pyamf_response[name] = base_gateway.getProcessor(message)(message)
>>>> response.headers['Content-Type'] = pyamf.remoting.CONTENT_TYPE return
>>>>  pyamf.remoting.encode(pyamf_response, context).getvalue()
>>>>
>>>>
>>>> Thanks in advance!
>>>> _______________________________________________
>>>> PyAMF dev mailing list - dev@...
>>>> http://lists.pyamf.org/mailman/listinfo/dev
>>>>
>>>>
>>>>
>>>>
>>>>        
>>> _______________________________________________
>>> PyAMF dev mailing list - dev@...
>>> http://lists.pyamf.org/mailman/listinfo/dev
>>>
>>>
>>>
>>>      
>> _______________________________________________
>> PyAMF dev mailing list - dev@...
>> http://lists.pyamf.org/mailman/listinfo/dev
>>
>>
>>    
>
>
> _______________________________________________
> PyAMF dev mailing list - dev@...
> http://lists.pyamf.org/mailman/listinfo/dev
>
>  



Re: Problems with Web2PY gateway

by lists-144 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Great to hear it's working. Could you maybe create a wiki page @ pyamf.org that we can add to the examples page [1]?

Cheers,

Thijs


On Jan 10, 2008, at 11:53 AM, akira wrote:

I would write a few sentence on how to set things up probably in a few days. 



Re: Problems with Web2PY gateway

by rpb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Thijs!

Sorry about the delay, this post escaped my view. I´ll be glad to create
a page with an example as soon as Web2py version 1.18 is out.

Thanks



Thijs Triemstra | Collab wrote:

> Great to hear it's working. Could you maybe create a wiki page @
> pyamf.org that we can add to the examples page [1]?
>
> Cheers,
>
> Thijs
>
> [1] http://pyamf.org/wiki/Examples
>
> On Jan 10, 2008, at 11:53 AM, akira wrote:
>
>> I would write a few sentence on how to set things up probably in a
>> few days.
>>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> PyAMF dev mailing list - dev@...
> http://lists.pyamf.org/mailman/listinfo/dev
>