-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPlaystationNetworkAPI_client.py
More file actions
60 lines (51 loc) · 2.33 KB
/
PlaystationNetworkAPI_client.py
File metadata and controls
60 lines (51 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
##################################################
# file: PlaystationNetworkAPI_client.py
#
# client stubs generated by "ZSI.generate.wsdl2python.WriteServiceModule"
# wsdl2py --complexType PlaystationNetworkAPI.wsdl
#
##################################################
from PlaystationNetworkAPI_types import *
import urlparse, types
from ZSI.TCcompound import ComplexType, Struct
from ZSI import client
from ZSI.schema import GED, GTD
import ZSI
from ZSI.generate.pyclass import pyclass_type
# Locator
class PlaystationNetworkAPILocator:
PlaystationNetworkAPISoap_address = "http://psnserverapi.appspot.com/PlaystationNetworkAPI"
def getPlaystationNetworkAPISoapAddress(self):
return PlaystationNetworkAPILocator.PlaystationNetworkAPISoap_address
def getPlaystationNetworkAPISoap(self, url=None, **kw):
return PlaystationNetworkAPISoapSOAP(url or PlaystationNetworkAPILocator.PlaystationNetworkAPISoap_address, **kw)
# Methods
class PlaystationNetworkAPISoapSOAP:
def __init__(self, url, **kw):
kw.setdefault("readerclass", None)
kw.setdefault("writerclass", None)
# no resource properties
self.binding = client.Binding(url=url, **kw)
# no ws-addressing
# op: GetProfile
def GetProfile(self, request, **kw):
if isinstance(request, GetProfileSoapIn) is False:
raise TypeError, "%s incorrect request type" % (request.__class__)
# no input wsaction
self.binding.Send(None, None, request, soapaction="GetProfile", **kw)
# no output wsaction
response = self.binding.Receive(GetProfileSoapOut.typecode)
return response
# op: GetOnlineFriends
def GetOnlineFriends(self, request, **kw):
if isinstance(request, GetOnlineFriendsSoapIn) is False:
raise TypeError, "%s incorrect request type" % (request.__class__)
# no input wsaction
self.binding.Send(None, None, request, soapaction="GetOnlineFriends", **kw)
# no output wsaction
response = self.binding.Receive(GetOnlineFriendsSoapOut.typecode)
return response
GetProfileSoapIn = GED("urn:PSN", "GetProfile").pyclass
GetProfileSoapOut = GED("urn:PSN", "GetProfileResponse").pyclass
GetOnlineFriendsSoapIn = GED("urn:PSN", "emptyElement").pyclass
GetOnlineFriendsSoapOut = GED("urn:PSN", "GetOnlineFriendsResponse").pyclass