texel-docusign 0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,179 @@
1
+ # require File.expand_path(File.dirname(__FILE__) + '/docusign.rb')
2
+ # require File.expand_path(File.dirname(__FILE__) + '/docusignMappingRegistry.rb')
3
+ # require 'docusign'
4
+ # require 'lib/docusignMappingRegistry'
5
+ require 'soap/rpc/driver'
6
+
7
+ #require 'wss4r/rpc/wssdriver'
8
+
9
+
10
+ module Docusign
11
+
12
+ class APIServiceSoap < ::SOAP::RPC::Driver
13
+ DefaultEndpointUrl = "https://www.docusign.net/api/3.0/api.asmx"
14
+
15
+ Methods = [
16
+ [ "http://www.docusign.net/API/3.0/CreateEnvelope",
17
+ "createEnvelope",
18
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "CreateEnvelope"]],
19
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "CreateEnvelopeResponse"]] ],
20
+ { :request_style => :document, :request_use => :literal,
21
+ :response_style => :document, :response_use => :literal,
22
+ :faults => {} }
23
+ ],
24
+ [ "http://www.docusign.net/API/3.0/CreateAndSendEnvelope",
25
+ "createAndSendEnvelope",
26
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "CreateAndSendEnvelope"]],
27
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "CreateAndSendEnvelopeResponse"]] ],
28
+ { :request_style => :document, :request_use => :literal,
29
+ :response_style => :document, :response_use => :literal,
30
+ :faults => {} }
31
+ ],
32
+ [ "http://www.docusign.net/API/3.0/CorrectAndResendEnvelope",
33
+ "correctAndResendEnvelope",
34
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "CorrectAndResendEnvelope"]],
35
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "CorrectAndResendEnvelopeResponse"]] ],
36
+ { :request_style => :document, :request_use => :literal,
37
+ :response_style => :document, :response_use => :literal,
38
+ :faults => {} }
39
+ ],
40
+ [ "http://www.docusign.net/API/3.0/RequestPDF",
41
+ "requestPDF",
42
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "RequestPDF"]],
43
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "RequestPDFResponse"]] ],
44
+ { :request_style => :document, :request_use => :literal,
45
+ :response_style => :document, :response_use => :literal,
46
+ :faults => {} }
47
+ ],
48
+ [ "http://www.docusign.net/API/3.0/RequestDocumentPDFs",
49
+ "requestDocumentPDFs",
50
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "RequestDocumentPDFs"]],
51
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "RequestDocumentPDFsResponse"]] ],
52
+ { :request_style => :document, :request_use => :literal,
53
+ :response_style => :document, :response_use => :literal,
54
+ :faults => {} }
55
+ ],
56
+ [ "http://www.docusign.net/API/3.0/RequestStatus",
57
+ "requestStatus",
58
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "RequestStatus"]],
59
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "RequestStatusResponse"]] ],
60
+ { :request_style => :document, :request_use => :literal,
61
+ :response_style => :document, :response_use => :literal,
62
+ :faults => {} }
63
+ ],
64
+ [ "http://www.docusign.net/API/3.0/RequestStatuses",
65
+ "requestStatuses",
66
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "RequestStatuses"]],
67
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "RequestStatusesResponse"]] ],
68
+ { :request_style => :document, :request_use => :literal,
69
+ :response_style => :document, :response_use => :literal,
70
+ :faults => {} }
71
+ ],
72
+ [ "http://www.docusign.net/API/3.0/GetRecipientEsignList",
73
+ "getRecipientEsignList",
74
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "GetRecipientEsignList"]],
75
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "GetRecipientEsignListResponse"]] ],
76
+ { :request_style => :document, :request_use => :literal,
77
+ :response_style => :document, :response_use => :literal,
78
+ :faults => {} }
79
+ ],
80
+ [ "http://www.docusign.net/API/3.0/VoidEnvelope",
81
+ "voidEnvelope",
82
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "VoidEnvelope"]],
83
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "VoidEnvelopeResponse"]] ],
84
+ { :request_style => :document, :request_use => :literal,
85
+ :response_style => :document, :response_use => :literal,
86
+ :faults => {} }
87
+ ],
88
+ [ "http://www.docusign.net/API/3.0/RequestRecipientToken",
89
+ "requestRecipientToken",
90
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "RequestRecipientToken"]],
91
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "RequestRecipientTokenResponse"]] ],
92
+ { :request_style => :document, :request_use => :literal,
93
+ :response_style => :document, :response_use => :literal,
94
+ :faults => {} }
95
+ ],
96
+ [ "http://www.docusign.net/API/3.0/TransferEnvelope",
97
+ "transferEnvelope",
98
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "TransferEnvelope"]],
99
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "TransferEnvelopeResponse"]] ],
100
+ { :request_style => :document, :request_use => :literal,
101
+ :response_style => :document, :response_use => :literal,
102
+ :faults => {} }
103
+ ],
104
+ [ "http://www.docusign.net/API/3.0/GetAccountMembershipFeaturesList",
105
+ "getAccountMembershipFeaturesList",
106
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "GetAccountMembershipFeaturesList"]],
107
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "GetAccountMembershipFeaturesListResponse"]] ],
108
+ { :request_style => :document, :request_use => :literal,
109
+ :response_style => :document, :response_use => :literal,
110
+ :faults => {} }
111
+ ],
112
+ [ "http://www.docusign.net/API/3.0/AcknowledgeAuthoritativeCopyExport",
113
+ "acknowledgeAuthoritativeCopyExport",
114
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "AcknowledgeAuthoritativeCopyExport"]],
115
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "AcknowledgeAuthoritativeCopyExportResponse"]] ],
116
+ { :request_style => :document, :request_use => :literal,
117
+ :response_style => :document, :response_use => :literal,
118
+ :faults => {} }
119
+ ],
120
+ [ "http://www.docusign.net/API/3.0/ExportAuthoritativeCopy",
121
+ "exportAuthoritativeCopy",
122
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "ExportAuthoritativeCopy"]],
123
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "ExportAuthoritativeCopyResponse"]] ],
124
+ { :request_style => :document, :request_use => :literal,
125
+ :response_style => :document, :response_use => :literal,
126
+ :faults => {} }
127
+ ],
128
+ [ "http://www.docusign.net/API/3.0/EnvelopeAuditEvents",
129
+ "envelopeAuditEvents",
130
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "EnvelopeAuditEvents"]],
131
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "EnvelopeAuditEventsResponse"]] ],
132
+ { :request_style => :document, :request_use => :literal,
133
+ :response_style => :document, :response_use => :literal,
134
+ :faults => {} }
135
+ ],
136
+ [ "http://www.docusign.net/API/3.0/Ping",
137
+ "ping",
138
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "Ping"]],
139
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/3.0", "PingResponse"]] ],
140
+ { :request_style => :document, :request_use => :literal,
141
+ :response_style => :document, :response_use => :literal,
142
+ :faults => {} }
143
+ ]
144
+ ]
145
+
146
+ def initialize(endpoint_url = nil)
147
+ endpoint_url ||= DefaultEndpointUrl
148
+ super(endpoint_url, nil)
149
+ self.mapping_registry = DefaultMappingRegistry::EncodedRegistry
150
+ self.literal_mapping_registry = DefaultMappingRegistry::LiteralRegistry
151
+ init_methods
152
+ end
153
+
154
+ private
155
+
156
+ def init_methods
157
+ Methods.each do |definitions|
158
+ opt = definitions.last
159
+ opt.merge!({
160
+ :attributeformdefault => true
161
+ })
162
+ if opt[:request_style] == :document
163
+ add_document_operation(*definitions)
164
+ else
165
+ add_rpc_operation(*definitions)
166
+ qname = definitions[0]
167
+ name = definitions[2]
168
+ if qname.name != name and qname.name.capitalize == name.capitalize
169
+ ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
170
+ __send__(name, *arg)
171
+ end
172
+ end
173
+ end
174
+ end
175
+ end
176
+ end
177
+
178
+
179
+ end