home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2012 January / maximum-cd-2012-01.iso / DiscContents / digsby_setup.exe / lib / msn / SOAP / services.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2011-10-05  |  22.8 KB  |  548 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. import logging
  5. log = logging.getLogger('msn.soap.services')
  6. import time
  7. import datetime
  8. import urlparse
  9. import uuid
  10. import util.network.soap as soap
  11. import MSNSecurityTokenService.SecurityTokenService_client as STS_Client
  12. import MSNSecurityTokenService.SecurityTokenService_types as STS_Types
  13. import msn.SOAP.xml.wsa as wsa
  14. import msn.SOAP.xml.wst as wst
  15. import msn.SOAP.xml.wsse as wsse
  16. import msn.SOAP.xml.wsu_oasis as wsu
  17. import msn.SOAP.xml.soapenv as soapenv
  18. import ZSI.schema as Schema
  19. import ZSI.wstools.Namespaces as NS
  20. import msn.SOAP.Namespaces as MSNS
  21.  
  22. def strtime_highres(t = None):
  23.     if t is None:
  24.         t = time.time()
  25.     
  26.     return None(time.strftime + '%Y-%m-%dT%H:%M:%S.0000000' % '%+03d:%02d'(-divmod if time.daylight else time.timezone, 3600), time.gmtime(t))
  27.  
  28.  
  29. def strptime_highres(s):
  30.     (tz_delim, direction) = None if '+' in s else ('-', -1)
  31.     (tstamp, tz_str) = s.rsplit(tz_delim, 1)
  32.     if 'T' in tz_str:
  33.         tz_offset = 0
  34.     else:
  35.         tz_struct = time.strptime(tz_str, '%H:%M')
  36.         tz_offset = 3600 * tz_struct.tm_hour + 60 * tz_struct.tm_min * direction
  37.         s = tstamp
  38.     if '.' in s:
  39.         (s, micro) = s.split('.', 1)
  40.     
  41.     ts = time.strptime(s, '%Y-%m-%dT%H:%M:%S')
  42.     if ts.tm_year < 1971:
  43.         return 0
  44.     return time.mktime(ts) + tz_offset
  45.  
  46.  
  47. class SsoDomains:
  48.     Clear = 'messengerclear.live.com'
  49.     STS = 'http://Passport.NET/tb'
  50.     WhatsUp = 'sup.live.com'
  51.     Messenger = 'messenger.msn.com'
  52.     Storage = 'storage.msn.com'
  53.     OfflineIM = 'messengersecure.live.com'
  54.     Contacts = 'contacts.msn.com'
  55.     Spaces = 'spaces.live.com'
  56.  
  57.  
  58. class AppIDs:
  59.     STS = uuid.UUID('7108E71A-9926-4FCB-BCC9-9A9D3F32E423')
  60.     WhatsUp = uuid.UUID('3B119D87-1D76-4474-91AD-0D7267E86D04')
  61.     AddressBook = uuid.UUID('CFE80F9D-180F-4399-82AB-413F33A1FA11')
  62.     Sharing = uuid.UUID('AAD9B99B-58E6-4F23-B975-D9EC1F9EC24A')
  63.     Storage = 'Messenger Client 9.0'
  64.     Spaces = 'Messenger Client 8.0'
  65.  
  66.  
  67. class PartnerScenario:
  68.     NONE = 'None'
  69.     Initial = 'Initial'
  70.     Timer = 'Timer'
  71.     BlockUnblock = 'BlockUnblock'
  72.     GroupSave = 'GroupSave'
  73.     GeneralDialogApply = 'GeneralDialogApply'
  74.     ContactSave = 'ContactSave'
  75.     ContactMsgrAPI = 'ContactMsgrAPI'
  76.     MessengerPendingList = 'MessengerPendingList'
  77.     PrivacyApply = 'PrivacyApply'
  78.     NewCircleDuringPull = 'NewCircleDuringPull'
  79.     CircleInvite = 'CircleInvite'
  80.     CircleIdAlert = 'CircleIdAlert'
  81.     CircleStatus = 'CircleStatus'
  82.     CircleSave = 'CircleSave'
  83.     CircleLeave = 'CircleLeave'
  84.     JoinedCircleDuringPush = 'JoinedCircleDuringPush'
  85.     ABChangeNotifyAlert = 'ABChangeNotifyAlert'
  86.     RoamingSeed = 'RoamingSeed'
  87.     RoamingIdentityChanged = 'RoamingIdentityChanged'
  88.  
  89.  
  90. class ClearService(object):
  91.     SSO = True
  92.     SSO_Domain = SsoDomains.Clear
  93.     SSO_PolicyRef = None
  94.  
  95.  
  96. class CacheKeyService(object):
  97.     CacheKeyName = None
  98.     
  99.     def __init__(self, *a, **k):
  100.         self.SessionId = None
  101.         self.PreferredHostName = None
  102.  
  103.     
  104.     def add_cachekey(self, client, appheader):
  105.         cachekey = client.get_cachekey(self.CacheKeyName)
  106.         if cachekey is not None:
  107.             appheader.CacheKey = cachekey
  108.         
  109.  
  110.     
  111.     def handleHeaders(self, client, headers):
  112.         log.info('CacheKeyService got soapheaders: %r', headers)
  113.         serviceHeader = headers.get((MSNS.MSWS.ADDRESS, 'ServiceHeader'), None)
  114.         if serviceHeader is None:
  115.             return None
  116.         if serviceHeader.CacheKeyChanged:
  117.             client.set_cachekey(self.CacheKeyName, str(serviceHeader.CacheKey))
  118.         
  119.         if not serviceHeader.SessionId:
  120.             pass
  121.         self.SessionId = self.SessionId
  122.         if not serviceHeader.PreferredHostName:
  123.             pass
  124.         self.PreferredHostName = self.PreferredHostName
  125.  
  126.     
  127.     def getPort(self, *a, **k):
  128.         client = k.get('client')
  129.         name = k.get('soapName')
  130.         locator = k.get('locator')
  131.         getPort = getattr(locator, 'get%sPort' % name, (lambda : pass))
  132.         default_port = getPort()
  133.         default_port_url = getattr(getattr(default_port, 'binding', None), 'url', None)
  134.         if client.get_cachekey(self.CacheKeyName) is None:
  135.             parsed = urlparse.urlparse(default_port_url)
  136.             cachekeyurl = urlparse.urlunparse(('https', self.CacheKeyDomain) + parsed[2:])
  137.             log.info('Changing endpoint of request from %r to %r for cachekey', default_port_url, cachekeyurl)
  138.             return getPort(cachekeyurl)
  139.         return default_port
  140.  
  141.  
  142.  
  143. class SecurityTokenService(object):
  144.     AppName = 'SecurityTokenService'
  145.     AppId = AppIDs.STS
  146.     Soap = STS_Client
  147.     Locator = STS_Client.SecurityTokenServiceLocator
  148.     SSO = True
  149.     SSO_Domain = SsoDomains.STS
  150.     SSO_PolicyRef = None
  151.     
  152.     def serviceurl_for_user(self, username):
  153.         if username.endswith('msn.com'):
  154.             return 'https://msnia.login.live.com/RST2.srf'
  155.  
  156.     
  157.     def getCredProperty(self, key):
  158.         return getattr(self, 'credProperties', { }).get(key, None)
  159.  
  160.     
  161.     def handleHeaders(self, client, headers):
  162.         self.credProperties = credprops = getattr(self, 'credProperties', { })
  163.         pp = headers.get((MSNS.PPCRL.FAULT, 'pp'), None)
  164.         if pp is not None:
  165.             log.info('SecurityTokenService got pp header: %r', pp)
  166.             for cp in pp.CredProperties.CredProperty:
  167.                 name = cp.get_attribute_Name()
  168.                 log.info('\tcredProperty: %s = %r', name, str(cp))
  169.                 credprops[name] = str(cp)
  170.             
  171.         
  172.  
  173.     
  174.     def serviceHeaders(self, client, actionValue = 'http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue', toValue = 'HTTPS://login.live.com:443//RST2.srf', *a, **k):
  175.         ai = STS_Types.ps.AuthInfo_Dec().pyclass()
  176.         ai.set_attribute_Id('PPAuthInfo')
  177.         ai.HostingApp = '{' + str(self.AppId).upper() + '}'
  178.         ai.BinaryVersion = 5
  179.         ai.Cookies = ''
  180.         ai.UIVersion = 1
  181.         ai.RequestParams = 'AQAAAAIAAABsYwQAAAAxMDMz'
  182.         sec = wsse.Security()
  183.         sec.UsernameToken = sec.new_UsernameToken()
  184.         sec.UsernameToken.set_attribute_Id('user')
  185.         sec.UsernameToken.Username = sec.UsernameToken.new_Username(client.get_username())
  186.         password = client.get_password()
  187.         sec.UsernameToken.Password = sec.UsernameToken.new_Password(password)
  188.         now = datetime.datetime.utcnow().replace(microsecond = 0)
  189.         ts = sec.Timestamp = sec.new_Timestamp()
  190.         ts.set_attribute_Id('Timestamp')
  191.         ts.Created = ts.new_Created(now.isoformat() + 'Z')
  192.         ts.Expires = ts.new_Expires((now + datetime.timedelta(minutes = 60)).isoformat() + 'Z')
  193.         messageid = wsa.MessageID(str(int(time.time())))
  194.         mustunderstand_attrs = {
  195.             (soapenv.wssoapenv.targetNamespace, 'mustUnderstand'): '1' }
  196.         
  197.         class Action('Action', ()):
  198.             typecode = wsa.wsa.Action_Dec(mixed = True)
  199.             _attrs = mustunderstand_attrs
  200.             _text = actionValue
  201.  
  202.         
  203.         class To('To', ()):
  204.             typecode = wsa.wsa.To_Dec(mixed = True)
  205.             _attrs = mustunderstand_attrs
  206.             _text = toValue
  207.  
  208.         return (Action, To, messageid, ai, sec)
  209.  
  210.     
  211.     def rst_for_service(self, msg, client, service, id):
  212.         domain = service.SSO_Domain
  213.         policyref = service.SSO_PolicyRef
  214.         rtok = msg.new_RequestSecurityToken()
  215.         rtok.set_attribute_Id(id)
  216.         rtok.RequestType = NS.WSTRUST.ISSUE
  217.         at = rtok.AppliesTo = rtok.new_AppliesTo()
  218.         at.EndpointReference = at.new_EndpointReference()
  219.         at.EndpointReference.Address = at.EndpointReference.new_Address(domain)
  220.         if policyref is not None:
  221.             rtok.PolicyReference = rtok.new_PolicyReference()
  222.             rtok.PolicyReference.set_attribute_URI(policyref)
  223.         
  224.         return rtok
  225.  
  226.     
  227.     def RequestSecurityToken(self, msg, client, actionValue = '', toValue = 'HTTPS://login.live.com:443//RST2.srf', service = None, *a, **k):
  228.         if service is None:
  229.             service = self
  230.         
  231.         msg.RequestSecurityToken = rst_for_service(msg, client, service, 'RST1')
  232.  
  233.     RequestSecurityToken = soap.soapcall(STS_Client)(RequestSecurityToken)
  234.     
  235.     def RequestMultipleSecurityTokens(self, msg, client, actionValue = 'http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue', toValue = 'HTTPS://login.live.com:443//RST2.srf', services = None, *a, **k):
  236.         msg.set_attribute_Id('RSTS')
  237.         tokens = []
  238.         for i, service in enumerate(client.getSsoServices()):
  239.             rtok = self.rst_for_service(msg, client, service, id = 'RST' + str(i))
  240.             tokens.append(rtok)
  241.         msg.RequestSecurityToken = tokens
  242.  
  243.     RequestMultipleSecurityTokens = soap.soapcall(STS_Client)(RequestMultipleSecurityTokens)
  244.  
  245. import MSNABSharingService.SharingService_client as Sharing_Client
  246. import MSNABSharingService.SharingService_types as Sharing_Types
  247.  
  248. class WhatsUpService(object):
  249.     AppName = 'WhatsUpService'
  250.     AppId = AppIDs.WhatsUp
  251.     Soap = Sharing_Client
  252.     Locator = Sharing_Client.WhatsUpServiceLocator
  253.     SSO = True
  254.     SSO_Domain = SsoDomains.WhatsUp
  255.     SSO_PolicyRef = 'MBI'
  256.     
  257.     def serviceHeaders(self, client, *a, **k):
  258.         app = Sharing_Types.WNApplicationHeader()
  259.         app.ApplicationId = app.new_ApplicationId(str(self.AppId).upper())
  260.         auth = Sharing_Types.WNAuthHeader()
  261.         auth.TicketToken = client.get_ticket(self.AppId).token
  262.         return (app, auth)
  263.  
  264.     
  265.     def GetContactsRecentActivity(self, msg, client, cid, count = 10, locales = [
  266.         'en-US']):
  267.         msg.EntityHandle = msg.new_entityHandle()
  268.         msg.EntityHandle.Cid = cid
  269.         msg.Locales = msg.new_locales()
  270.         msg.Locales.String.extend(locales)
  271.         msg.Count = count
  272.         return True
  273.  
  274.     GetContactsRecentActivity = soap.soapcall(Sharing_Client)(GetContactsRecentActivity)
  275.  
  276.  
  277. class SharingServiceBase(CacheKeyService):
  278.     CacheKeyName = 'omega'
  279.     CacheKeyDomain = 'byrdr.omega.contacts.msn.com'
  280.     
  281.     def handleHeaders(self, client, headers):
  282.         log.info('SharingService got soapheaders: %r', headers)
  283.         super(SharingServiceBase, self).handleHeaders(client = client, headers = headers)
  284.         self._recv_headers = headers
  285.  
  286.     
  287.     def serviceHeaders(self, client, *a, **k):
  288.         ticket = client.get_ticket(SsoDomains.Contacts)
  289.         app = Schema.GED(MSNS.MSWS.ADDRESS, 'ABApplicationHeader').pyclass()
  290.         app.ApplicationId = app.new_ApplicationId(str(AppIDs.Sharing).upper())
  291.         app.IsMigration = False
  292.         app.PartnerScenario = getattr(PartnerScenario, k.get('PartnerScenario', 'Initial'), 'Initial')
  293.         app.BrandId = getattr(ticket, 'BrandId', 'MSFT')
  294.         self.add_cachekey(client, app)
  295.         auth = Schema.GED(MSNS.MSWS.ADDRESS, 'ABAuthHeader').pyclass()
  296.         auth.TicketToken = ticket.token
  297.         auth.ManagedGroupRequest = False
  298.         return (app, auth)
  299.  
  300.  
  301.  
  302. class SharingService(SharingServiceBase):
  303.     AppName = 'SharingService'
  304.     AppId = AppIDs.Sharing
  305.     Soap = Sharing_Client
  306.     Locator = Sharing_Client.SharingServiceLocator
  307.     SSO = True
  308.     SSO_Domain = SsoDomains.Contacts
  309.     SSO_PolicyRef = 'MBI'
  310.     
  311.     def FindMembership(self, msg, client, view = 'Full', deltasOnly = False, lastChange = 0, **k):
  312.         msg.View = view
  313.         msg.DeltasOnly = deltasOnly
  314.         msg.LastChange = lastChange
  315.         msg.ServiceFilter = msg.new_serviceFilter()
  316.         msg.ServiceFilter.Types = msg.ServiceFilter.new_Types()
  317.         msg.ServiceFilter.Types.ServiceType.append('Messenger')
  318.  
  319.     FindMembership = soap.soapcall()(FindMembership)
  320.     
  321.     def AddMember(self, msg, client, *a, **k):
  322.         raise NotImplementedError
  323.  
  324.     AddMember = soap.soapcall()(AddMember)
  325.     
  326.     def DeleteMember(self, msg, client, *a, **k):
  327.         raise NotImplementedError
  328.  
  329.     DeleteMember = soap.soapcall()(DeleteMember)
  330.     
  331.     def CreateCircle(self, msg, client, *a, **k):
  332.         raise NotImplementedError
  333.  
  334.     CreateCircle = soap.soapcall()(CreateCircle)
  335.  
  336.  
  337. class ABService(SharingServiceBase):
  338.     AppName = 'ABService'
  339.     AppId = AppIDs.AddressBook
  340.     Soap = Sharing_Client
  341.     Locator = Sharing_Client.ABServiceLocator
  342.     abId = uuid.UUID(int = 0)
  343.     SSO = True
  344.     SSO_Domain = SsoDomains.Contacts
  345.     SSO_PolicyRef = 'MBI'
  346.     
  347.     def ABFindAll(self, msg, client, view = 'Full', deltas = False, lastChange = 0, **k):
  348.         msg.set_element_abId(msg.new_abId(str(self.abId)))
  349.         msg.AbView = view
  350.         msg.DeltasOnly = deltas
  351.         msg.LastChange = lastChange
  352.  
  353.     ABFindAll = soap.soapcall()(ABFindAll)
  354.     
  355.     def ABFindContactsPaged(self, msg, client, view = 'Full', deltas = False, lastChange = 0, **k):
  356.         msg.set_element_abView('MessengerClient8')
  357.         msg.set_element_extendedContent('AB AllGroups CircleResult')
  358.         fo = msg.new_filterOptions()
  359.         msg.set_element_filterOptions(fo)
  360.         fo.set_element_ContactFilter(fo.new_ContactFilter())
  361.         fo.DeltasOnly = deltas
  362.         fo.LastChanged = lastChange
  363.         fo.ContactFilter.IncludeHiddenContacts = True
  364.  
  365.     ABFindContactsPaged = soap.soapcall()(ABFindContactsPaged)
  366.     
  367.     def ABContactAdd(self, msg, client, **k):
  368.         raise NotImplementedError
  369.  
  370.     ABContactAdd = soap.soapcall()(ABContactAdd)
  371.     
  372.     def ABContactDelete(self, msg, client, **k):
  373.         raise NotImplementedError
  374.  
  375.     ABContactDelete = soap.soapcall()(ABContactDelete)
  376.     
  377.     def ABGroupAdd(self, msg, client, **k):
  378.         raise NotImplementedError
  379.  
  380.     ABGroupAdd = soap.soapcall()(ABGroupAdd)
  381.     
  382.     def ABGroupDelete(self, msg, client, **k):
  383.         raise NotImplementedError
  384.  
  385.     ABGroupDelete = soap.soapcall()(ABGroupDelete)
  386.     
  387.     def ABGroupContactDelete(self, msg, client, **k):
  388.         raise NotImplementedError
  389.  
  390.     ABGroupContactDelete = soap.soapcall()(ABGroupContactDelete)
  391.     
  392.     def ABContactUpdate(self, msg, client, **k):
  393.         raise NotImplementedError
  394.  
  395.     ABContactUpdate = soap.soapcall()(ABContactUpdate)
  396.     
  397.     def ABAdd(self, msg, client, **k):
  398.         raise NotImplementedError
  399.  
  400.     ABAdd = soap.soapcall()(ABAdd)
  401.     
  402.     def UpdateDynamicItem(self, msg, client, **k):
  403.         raise NotImplementedError
  404.  
  405.     UpdateDynamicItem = soap.soapcall()(UpdateDynamicItem)
  406.     
  407.     def CreateContact(self, msg, client, **k):
  408.         raise NotImplementedError
  409.  
  410.     CreateContact = soap.soapcall()(CreateContact)
  411.     
  412.     def ManageWLConnection(self, msg, client, **k):
  413.         raise NotImplementedError
  414.  
  415.     ManageWLConnection = soap.soapcall()(ManageWLConnection)
  416.     
  417.     def BreakConnection(self, msg, client, **k):
  418.         raise NotImplementedError
  419.  
  420.     BreakConnection = soap.soapcall()(BreakConnection)
  421.     
  422.     def AddDynamicItem(self, msg, client, **k):
  423.         raise NotImplementedError
  424.  
  425.     AddDynamicItem = soap.soapcall()(AddDynamicItem)
  426.  
  427. import MSNStorageService.StorageService_client as Storage_Client
  428. import MSNStorageService.StorageService_types as Storage_Types
  429.  
  430. class StorageService(CacheKeyService):
  431.     CacheKeyName = 'storage'
  432.     CacheKeyDomain = 'tkrdr.storage.msn.com'
  433.     SSO = True
  434.     SSO_PolicyRef = 'MBI'
  435.     SSO_Domain = SsoDomains.Storage
  436.     AppName = 'StorageService'
  437.     AppId = AppIDs.Storage
  438.     Soap = Storage_Client
  439.     Locator = Storage_Client.StorageServiceLocator
  440.     
  441.     def serviceHeaders(self, client, scenario = 'Initial', **k):
  442.         App = Schema.GED(MSNS.MSWS.STORAGE, 'StorageApplicationHeader').pyclass()
  443.         User = Schema.GED(MSNS.MSWS.STORAGE, 'StorageUserHeader').pyclass()
  444.         Affinity = Schema.GED(MSNS.MSWS.STORAGE, 'AffinityCacheHeader').pyclass()
  445.         App.ApplicationID = self.AppId
  446.         App.Scenario = scenario
  447.         User.Puid = 0
  448.         User.TicketToken = client.get_ticket(self.SSO_Domain).token
  449.         self.add_cachekey(client, Affinity)
  450.         return (App, User, Affinity)
  451.  
  452.     
  453.     def FindDocuments(self, msg, client, **k):
  454.         raise NotImplementedError
  455.  
  456.     FindDocuments = soap.soapcall()(FindDocuments)
  457.     
  458.     def CreateProfile(self, msg, client, **k):
  459.         raise NotImplementedError
  460.  
  461.     CreateProfile = soap.soapcall()(CreateProfile)
  462.     
  463.     def GetProfile(self, msg, client, scenario, **k):
  464.         ph = msg.ProfileHandle = msg.new_profileHandle()
  465.         alias = ph.Alias = ph.new_Alias()
  466.         alias.NameSpace = 'MyCidStuff'
  467.         alias.Name = str(client.contact_list.owner.CID)
  468.         ph.RelationshipName = 'MyProfile'
  469.         pa = msg.ProfileAttributes = msg.new_profileAttributes()
  470.         pa.ResourceID = True
  471.         pa.DateModified = True
  472.         expattr = pa.ExpressionProfileAttributes = pa.new_ExpressionProfileAttributes()
  473.         for attr in ('DateModified', 'DateModifiedSpecified', 'DisplayName', 'DisplayNameLastModified', 'DisplayNameLastModifiedSpecified', 'DisplayNameSpecified', 'Flag', 'FlagSpecified', 'PersonalStatus', 'PersonalStatusLastModified', 'PersonalStatusLastModifiedSpecified', 'PersonalStatusSpecified', 'Photo', 'PhotoSpecified', 'Attachments', 'AttachmentsSpecified', 'ResourceID', 'ResourceIDSpecified', 'StaticUserTilePublicURL', 'StaticUserTilePublicURLSpecified'):
  474.             setattr(expattr, attr, True)
  475.         
  476.  
  477.     GetProfile = soap.soapcall()(GetProfile)
  478.     
  479.     def CreateRelationships(self, msg, client, **k):
  480.         raise NotImplementedError
  481.  
  482.     CreateRelationships = soap.soapcall()(CreateRelationships)
  483.     
  484.     def UpdateProfile(self, msg, client, **k):
  485.         raise NotImplementedError
  486.  
  487.     UpdateProfile = soap.soapcall()(UpdateProfile)
  488.     
  489.     def ShareItem(self, msg, client, **k):
  490.         raise NotImplementedError
  491.  
  492.     ShareItem = soap.soapcall()(ShareItem)
  493.     
  494.     def UpdateDocument(self, msg, client, **k):
  495.         raise NotImplementedError
  496.  
  497.     UpdateDocument = soap.soapcall()(UpdateDocument)
  498.     
  499.     def CreateDocument(self, msg, client, **k):
  500.         raise NotImplementedError
  501.  
  502.     CreateDocument = soap.soapcall()(CreateDocument)
  503.     
  504.     def DeleteRelationships(self, msg, client, **k):
  505.         raise NotImplementedError
  506.  
  507.     DeleteRelationships = soap.soapcall()(DeleteRelationships)
  508.  
  509. import MSNSpaceService.SpaceService_client as Spaces_Client
  510. import MSNSpaceService.SpaceService_types as Spaces_Types
  511.  
  512. class SpacesService(object):
  513.     AppName = 'SpaceService'
  514.     SSO = True
  515.     SSO_PolicyRef = 'MBI'
  516.     SSO_Domain = SsoDomains.Spaces
  517.     AppId = AppIDs.Spaces
  518.     Soap = Spaces_Client
  519.     Locator = Spaces_Client.SpaceServiceLocator
  520.     
  521.     def serviceHeaders(self, client, *a, **k):
  522.         ticket = client.get_ticket(SsoDomains.Contacts)
  523.         auth = Schema.GED(MSNS.MSWS.SPACES, 'AuthTokenHeader').pyclass()
  524.         auth.Token = ticket.token
  525.         return (auth,)
  526.  
  527.     
  528.     def GetXmlFeed(self, msg, client, CID, **k):
  529.         ri = msg.RefreshInformation = msg.new_refreshInformation()
  530.         ri.Cid = CID
  531.         ri.StorageAuthCache = ''
  532.         ri.Market = 'en-US'
  533.         ri.Brand = ''
  534.         ri.MaxElementCount = 15
  535.         ri.MaxCharacterCount = 200
  536.         ri.MaxImageCount = 6
  537.         ri.ApplicationId = 'Messenger Client 8.0'
  538.         ri.UpdateAccessedTime = False
  539.         import datetime
  540.         yesterday = time.mktime((datetime.datetime.today() - datetime.timedelta(1)).timetuple())
  541.         ri.SpaceLastViewed = yesterday
  542.         ri.ProfileLastViewed = yesterday
  543.         ri.ContactProfileLastViewed = yesterday
  544.         ri.IsActiveContact = False
  545.  
  546.     GetXmlFeed = soap.soapcall()(GetXmlFeed)
  547.  
  548.