summaryrefslogtreecommitdiff
path: root/tests/public.py
blob: 4b67dc2739de13be1eef656b2382ac74e8ce57d5 (plain)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the 
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library Lesser General Public License for more details at
# ( http://www.gnu.org/licenses/lgpl.html ).
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# written by: Jeff Ortel ( jortel@redhat.com )

import sys
sys.path.append('../')

import logging
import traceback as tb
import suds.metrics as metrics
from tests import *
from suds import WebFault
from suds.client import Client

errors = 0

setup_logging()

from suds.xsd.sxbasic import Import
Import.bind('http://schemas.xmlsoap.org/soap/encoding/')

#logging.getLogger('suds.client').setLevel(logging.DEBUG)
#logging.getLogger('suds.metrics').setLevel(logging.DEBUG)
#logging.getLogger('suds').setLevel(logging.DEBUG)

def start(url):
    global errors
    print '\n________________________________________________________________\n' 
    print 'Test @ ( %s ) %d' % (url, errors)
    
try:
    url = 'http://jira.atlassian.com/rpc/soap/jirasoapservice-v2?wsdl'
    start(url)
    client = Client(url)
    print client
    token = client.service.login('soaptester', 'soaptester')
    print 'token="%s"' % token
    user = client.service.getUser(token, 'soaptester')
    print 'user="%s"' % token
except WebFault, f:
    errors += 1
    print f
    print f.fault
except Exception, e: 
    errors += 1
    print e
    tb.print_exc()
    
try:
    url = ' http://www.webservicex.net/WeatherForecast.asmx?WSDL '
    start(url)
    client = Client(url)
    print client
    print client.service.GetWeatherByZipCode('27606')
except WebFault, f:
    errors += 1
    print f
    print f.fault
except Exception, e: 
    errors += 1
    print e
    tb.print_exc()
    
try:
    url = ' http://www.boyzoid.com/comp/randomQuote.cfc?wsdl '
    start(url)
    client = Client(url)
    print client
    print client.service.getQuote(False)
except WebFault, f:
    errors += 1
    print f
    print f.fault
except Exception, e:
    errors += 1
    print e
    tb.print_exc()
    
try:
    url = 'http://www.zenfolio.com/zf/api/zfapi.asmx?wsdl'
    start(url)
    client = Client(url)
    print client
    #client.setport(0)
    group = client.factory.create('Group')
    print 'Group:\n%s' % group
    print 'LoadGroupHierarchy("demo")'
    groupHierarchy = client.service.LoadGroupHierarchy("demo")
    print 'result:\n%s' % groupHierarchy
except WebFault, f:
    errors += 1
    print f
    print f.fault
except Exception, e:
    errors += 1
    print e
    tb.print_exc()
    
try:
    url = 'http://cert.synxis.com/interface/ChannelConnect.asmx?WSDL'
    start(url)
    client = Client(url)
    print client
    #client.setport(0)
    tpa = client.factory.create('ns1:TPA_Extensions')
    print client.service.Ping(tpa, "hello")
except WebFault, f:
    errors += 1
    print f
    print f.fault
except Exception, e:
    errors += 1
    print e
    tb.print_exc()

try:
    url = 'https://sec.neurofuzz-software.com/paos/genSSHA-SOAP.php?wsdl'
    start(url)
    client = Client(url)
    print client
    print client.service.genSSHA('hello', 'sha1')
except WebFault, f:
    errors += 1
    print f
    print f.fault
except Exception, e:
    errors += 1
    print e
    tb.print_exc()

try:
    url = 'http://ap1314-dsr.compmed.ucdavis.edu/dataserver/Aperio.Images/Image?method=wsdl'
    start(url)
    client = Client(url)
    #print client.factory.resolver.schema
    print client
    print 'Logon()'
    reply = client.service.Logon('testuser','test')
    print reply
except WebFault, f:
    errors += 1
    print f
    print f.fault
except Exception, e:
    errors += 1
    print e
    tb.print_exc()

try:
    url = 'http://soa.ebrev.info/service.wsdl'
    start(url)
    client = Client(url)
    print client
except WebFault, f:
    errors += 1
    print f
    print f.fault
except Exception, e:
    errors += 1
    print e
    tb.print_exc()

try:
    url = 'http://www.services.coxnewsweb.com/COXnetUR/URService?WSDL'
    start(url)
    client = Client(url)
    print client
    bean = client.service.getUserBean('abc', '123', 'mypassword', 'myusername')
except WebFault, f:
    errors += 1
    print f
    print f.fault
except Exception, e:
    errors += 1
    print e
    tb.print_exc()

try:
    url = 'http://arcweb.esri.com/services/v2/MapImage.wsdl'
    start(url)
    client = Client(url)
    print client
    env = client.factory.create('ns2:Envelope')
    print env
    options = client.factory.create('ns4:MapImageOptions')
    print options
except WebFault, f:
    errors += 1
    print f
    print f.fault
except Exception, e:
    errors += 1
    print e
    tb.print_exc()

try:
    url = "http://www.thomas-bayer.com/axis2/services/BLZService?wsdl"
    start(url)
    client = Client(url)
    print client
    #client.setport(0)
    print client.service.getBank("76251020")
except WebFault, f:
    errors += 1
    print f
    print f.fault
except Exception, e:
    errors += 1
    print e
    tb.print_exc()
    
try:
    url = "http://arcweb.esri.com/services/v2/RouteFinder.wsdl"
    start(url)
    client = Client(url)
    print client
except WebFault, f:
    errors += 1
    print f
    print f.fault
except Exception, e:
    errors += 1
    print e
    tb.print_exc()

timer = metrics.Timer()

try:
    url = "https://www.e-conomic.com/secure/api1/EconomicWebService.asmx?WSDL"
    start(url)
    timer.start()
    client = Client(url)
    #client.setport(0)
    timer.stop()
    print 'create client: %s' % timer
    timer.start()
    s = str(client)
    timer.stop()
    print 'str(client): %s' % timer
    print 'client:\n%s' % s
    print 'Account_GetAll()'
    a = client.service.Account_GetAll()
    print a
except WebFault, f:
    errors += 1
    print f
    print f.fault
except Exception, e:
    errors += 1
    print e
    tb.print_exc()

print '\nFinished: errors = %d' % errors