[Papyon] contacts

Massimo Scamarcia massimo.scamarcia at gmail.com
Tue Jul 27 08:24:07 PDT 2010


I have built a MSN bot, currently using the latest papyon changset
from git and I am using the new method
`on_address_book_contact_pending` of
`papyon.event.AddressBookEventInteface` to add PENDING contacts into
my own contact list:

class AddressBookEventHandler(papyon.event.AddressBookEventInterface):
    def on_addressbook_contact_pending(self, contacts):
        ab = self._client.address_book
        for c in contacts:
            ab.accept_contact_invitation(c)

The method is called as well but I am receiving an Internal Server
Error from SOAP API request while accepting contact invitation
(passportName is omitted):

[D 2010-07-27 14:07:51,654] papyon.service >>> POST
/abservice/abservice.asmx HTTP/1.0
Content-Length: 1984
Proxy-Connection: Keep-Alive
SOAPAction: http://www.msn.com/webservices/AddressBook/ABContactAdd
Host: contacts.msn.com:80
Accept: text/*
User-Agent: gnet/0.1 (Linux x86_64)
Connection: Keep-Alive
Cache-Control: no-cache
Content-Type: text/xml; charset=utf-8
Accept-Encoding: gzip

<?xml version='1.0' encoding='utf-8'?><soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ABApplicationHeader
xmlns="http://www.msn.com/webservices/AddressBook"><ApplicationId
xmlns="http://www.msn.com/webservices/AddressBook">996CDE1E-AA53-4477-B943-2BE802EA6166</ApplicationId><IsMigration
xmlns="http://www.msn.com/webservices/AddressBook">false</IsMigration><PartnerScenario
xmlns="http://www.msn.com/webservices/AddressBook">ContactSave</PartnerScenario></ABApplicationHeader><ABAuthHeader
xmlns="http://www.msn.com/webservices/AddressBook"><ManagedGroupRequest
xmlns="http://www.msn.com/webservices/AddressBook">false</ManagedGroupRequest><TicketToken
xmlns="http://www.msn.com/webservices/AddressBook">t=9U4P3dCD4G53SPeCu3BSdZ!L34LzyvNtwlBLkohedFqBu4019CDlVdNvww0T8yv9g35*dZgInh9T2zf5E40NRgrmaB8!MYkx5Zecc*IwvB53LnrLBUgDe1R3cohvY1vscndseDv3GLXr8Y1B1gfUn7B3BLjpW!s*am&amp;p=9oOcUjMgC2PgBRNdf1RKPsAM1gzqXoDcWty*JpqDb7N8Uc72ZexGFMMdyAHfWkUUHw1vnBRI8tyWMSrVNBFNt!Yga9XfN0yUkfVo4iVBvXQjacazGhD!RTQP**9Dhi4pU16NysWkbgOaedc2H7BwKpoxoamG*uZPf806JMHpaKShp6!n*2l4XpRRMiJuCoZfP8M0anrWOX77MSlazEC9!0cXLTqpTxtSmjiGhvhtzQp!7JUjhW8U*xclQ*tvfFoP5</TicketToken></ABAuthHeader></soap:Header><soap:Body><ABContactAdd
xmlns="http://www.msn.com/webservices/AddressBook"><abId>00000000-0000-0000-0000-000000000000</abId><contacts><Contact
xmlns="http://www.msn.com/webservices/AddressBook"><contactInfo><passportName>***********@hotmail.com</passportName><isMessengerUser>true</isMessengerUser><contactType>Regular<contactType><MessengerMemberInfo><PendingAnnotations><Annotation><Name>MSN.IM.InviteMessage</Name><Value></Value></Annotation></PendingAnnotations><DisplayName></DisplayName></MessengerMemberInfo></contactInfo></Contact></contacts><options><EnableAllowListManagement>true</EnableAllowListManagement></options></ABContactAdd></soap:Body></soap:Envelope>
[D 2010-07-27 14:07:57,017] papyon.service <<< HTTP/1.1 500 Internal
Server Error
Connection: keep-alive
Date: Tue, 27 Jul 2010 12:07:56 GMT
Server: Microsoft-IIS/6.0
P3P: CP="BUS CUR CONo FIN IVDo ONL OUR PHY SAMo TELo"
X-Powered-By: ASP.NET
X-MSNSERVER: BY2ABCHWB364
X-AspNet-Version: 2.0.50727
Content-Encoding: gzip
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 534

<gzip encoded data>
[E 2010-07-27 14:07:57,018] m3.gw.msn-papyon ERROR: 3 -> 0
[I 2010-07-27 14:07:57,018] m3.gw.msn-papyon Address book error!
[D 2010-07-27 14:07:57,059] papyon.transport >>> OUT 14
[I 2010-07-27 14:07:57,060] m3.gw.msn-papyon Client state: CLOSED

That is also causing client's disconnection.

Is there something wrong with the above mentioned code? Have you ever
experienced similar problems while accepting PENDING contacts?

I'm not pretty sure if it's related with messy and/or blocked address
book because I have not reached MSN network limits and accepting
PENDING contacts works well with traditional clients such as Empathy
or Windows Live Messenger.

Thanks in advance,
Massimo


More information about the papyon mailing list