1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 """
18 The service proxy provides access to web services.
19
20 Replaced by: L{client.Client}
21 """
22
23 from logging import getLogger
24 from suds import *
25 from suds.client import Client
26
27 log = getLogger(__name__)
28
29
31
32 """
33 A lightweight soap based web service proxy.
34 @ivar __client__: A client.
35 Everything is delegated to the 2nd generation API.
36 @type __client__: L{Client}
37 @note: Deprecated, replaced by L{Client}.
38 """
39
41 """
42 @param url: The URL for the WSDL.
43 @type url: str
44 @param kwargs: keyword arguments.
45 @keyword faults: Raise faults raised by server (default:True),
46 else return tuple from service method invocation as (http code, object).
47 @type faults: boolean
48 @keyword proxy: An http proxy to be specified on requests (default:{}).
49 The proxy is defined as {protocol:proxy,}
50 @type proxy: dict
51 """
52 client = Client(url, **kwargs)
53 self.__client__ = client
54
56 """
57 Get an instance of a WSDL type by name
58 @param name: The name of a type defined in the WSDL.
59 @type name: str
60 @return: An instance on success, else None
61 @rtype: L{sudsobject.Object}
62 """
63 return self.__client__.factory.create(name)
64
66 """
67 Get an instance of an enumeration defined in the WSDL by name.
68 @param name: The name of a enumeration defined in the WSDL.
69 @type name: str
70 @return: An instance on success, else None
71 @rtype: L{sudsobject.Object}
72 """
73 return self.__client__.factory.create(name)
74
76 return str(self.__client__)
77
79 return unicode(self.__client__)
80
82 builtin = name.startswith('__') and name.endswith('__')
83 if builtin:
84 return self.__dict__[name]
85 else:
86 return getattr(self.__client__.service, name)
87