1 | #!/use/bin/env python |
---|
2 | #from M2Crypto.httpslib import HTTPSConnection |
---|
3 | from ndg.security.common.m2CryptoSSLUtility import HTTPSConnection |
---|
4 | |
---|
5 | #hostname = u'ndgbeta.badc.rl.ac.uk' |
---|
6 | hostname = u'gabriel.badc.rl.ac.uk' |
---|
7 | path = u'/SessionManager' |
---|
8 | # |
---|
9 | #body = '''<SOAP-ENV:Envelope |
---|
10 | #xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" |
---|
11 | #xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" |
---|
12 | #xmlns:ns1="urn:ndg.security.sessionMgr"> |
---|
13 | #<SOAP-ENV:Header></SOAP-ENV:Header> |
---|
14 | #<SOAP-ENV:Body><ns1:getAttCert/></SOAP-ENV:Body>''' |
---|
15 | |
---|
16 | #con = HTTPSConnection(hostname) |
---|
17 | #con.putrequest('POST', path) |
---|
18 | #con.putheader('Content-Type', 'text/xml') |
---|
19 | #con.putheader('Content-Length', str(len(body))) |
---|
20 | #con.endheaders() |
---|
21 | #con.send(body) |
---|
22 | #resp = con.getresponse() |
---|
23 | #print resp.read() |
---|
24 | |
---|
25 | con = HTTPSConnection(hostname) |
---|
26 | con.putrequest('GET', path) |
---|
27 | con.endheaders() |
---|
28 | resp = con.getresponse() |
---|
29 | print resp.read() |
---|
30 | |
---|
31 | #from httplib import HTTPConnection |
---|
32 | # |
---|
33 | #hostname = 'gabriel.badc.rl.ac.uk' |
---|
34 | #port = 5000 |
---|
35 | #path = u'/AttributeAuthority' |
---|
36 | # |
---|
37 | #body = '''<SOAP-ENV:Envelope |
---|
38 | #xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" |
---|
39 | #xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" |
---|
40 | #xmlns:ns1="urn:ndg.security.attAuthority"> |
---|
41 | #<SOAP-ENV:Header></SOAP-ENV:Header> |
---|
42 | #<SOAP-ENV:Body><ns1:getX509Cert/></SOAP-ENV:Body>''' |
---|
43 | # |
---|
44 | #con = HTTPConnection(hostname, port=5000) |
---|
45 | #con.putrequest('POST', path) |
---|
46 | #con.putheader('Content-Type', 'text/xml') |
---|
47 | #con.putheader('Content-Length', str(len(body))) |
---|
48 | #con.endheaders() |
---|
49 | #con.send(body) |
---|
50 | #resp = con.getresponse() |
---|
51 | #print resp.read() |
---|
52 | |
---|
53 | |
---|
54 | |
---|