1
# -*- coding: utf-8 -*-
3
# pymsn - a python client library for Msn
5
# Copyright (C) 2007 Johann Prieur <johann.prieur@gmail.com>
7
# This program is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 2 of the License, or
10
# (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with this program; if not, write to the Free Software
19
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
import xml.sax.saxutils as xml
23
__all__ = ['soap_header']
25
def soap_header(scenario, security_token):
26
"""Returns the SOAP xml header"""
29
<ABApplicationHeader xmlns="http://www.msn.com/webservices/AddressBook">
30
<ApplicationId xmlns="http://www.msn.com/webservices/AddressBook">996CDE1E-AA53-4477-B943-2BE802EA6166</ApplicationId>
31
<IsMigration xmlns="http://www.msn.com/webservices/AddressBook">false</IsMigration>
32
<PartnerScenario xmlns="http://www.msn.com/webservices/AddressBook">%s</PartnerScenario>
33
</ABApplicationHeader>
34
<ABAuthHeader xmlns="http://www.msn.com/webservices/AddressBook">
35
<ManagedGroupRequest xmlns="http://www.msn.com/webservices/AddressBook">false</ManagedGroupRequest>
36
<TicketToken xmlns="http://www.msn.com/webservices/AddressBook">%s</TicketToken>
37
</ABAuthHeader>""" % (xml.escape(scenario), xml.escape(security_token))