>>> service = amf.RemotingService('http://bsd6.tv:8000/gateway/', 'calculateService', 3);
>>> print service.save(2, 3);
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.4/site-packages/amf/__init__.py", line 255, in __call__
faultString=result.get('description', ''),
AttributeError: 'NoneType' object has no attribute 'get'
Can anybody give me some hints for debugging?
Thanks.
-- Arthur
RE: Debug amf.RemotingService (2007-09-23 18:33 by arthur #32443)
Dear Everyone,
Sorry to post again with more detail explanation--
I do the following steps but unfortunately kept getting error message,
would you please help me?
―――――――–
/www/Django# django-admin.py startproject calculate; cd calculate;
/www/Django/calculate# md example
―――-test AMF in python ――――――――-
import amf;
service = amf.RemotingService(’http://localhost:8000/gateway/’, ‘calculateService’, 3);
print service.calculate(2, 3);
===> Then, I get the error:
Traceback (most recent call last):
File “”, line 1, in ?
File “/usr/local/lib/python2.4/site-packages/amf/__init__.py”, line 255, in __call__
faultString=result.get(’description’, ”),
AttributeError: ‘NoneType’ object has no attribute ‘get’
―–
Would you please give me some hints for debugging? Thanks a lots.
RE: Debug amf.RemotingService (2007-09-23 18:56 by otsuka #32444)
Hi Arthur,
What version of Django AMF do you use?
If you use the older one, please use the latest version.
The traceback message above shows that the fault response is returned from the server. So I guess that the traceback message is displayed in a console window which run the django development server. If true, could you post the serverside traceback?
RE: Debug amf.RemotingService (2007-10-31 00:23 by arthur #33074)
Thank you. After I installed newest version it works.
However, I found that
--- vi models.py -------------
from django.db import models
class Card(models.Model):
lastName = models.CharField(maxlength=20)
firstName = models.CharField(maxlength=20)
company = models.CharField(maxlength=50)
tel = models.CharField(maxlength=15)
email = models.EmailField(null=True)
zip = models.CharField(maxlength=8)
address = models.CharField(maxlength=200)
url = models.CharField(null=True, maxlength=250)
birthday = models.DateField(null=True)
portraitUrl = models.CharField(null=True, maxlength=250)
-------------------------
>>service = amf.RemotingService('http://bsd6.tv:8000/gateway/', 'addressBookService', 3);
>>print service.getCards()
I will get "HTTP Error 500: INTERNAL SERVER ERROR"
and in server side it said:
File "/usr/local/lib/python2.4/site-packages/amf/amf0.py", line 250, in write_long
output.write(struct.pack('L', long(socket.htonl(l))))
OverflowError: can't convert negative value to unsigned long
but if I mark out the last one in models.py, i.e.,
# portraitUrl = models.CharField(null=True, maxlength=250)
then,
>>print service.getCards() works
it returned:
{'tel': '2', 'zip': '', 'firstName': '2', 'url': None, 'lastName': '2', 'company': '2', 'id': 1, 'birthday': None, 'address': '', 'portrait': None, 'email': None, '_explicitType': 'addressbook.models.Card'}
Is there anything wrong in /usr/local/lib/python2.4/site-packages/amf/amf0.py"?
Thank you in advance.