Leser: 4
4 Einträge, 1 Seite |
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
#!/usr/bin/perl -w use strict; use SOAP::Lite; use SOAP::Data; use Digest::MD5 qw(md5_hex); my $logonData = SOAP::Data->name('TMWLogonReq' => {'version' => '100', 'username' => 'user', 'password' => md5_hex('passwd')}); my $method = SOAP::Data->name('logon') ->attr({xmlns => 'http://authorization.xxxx.de/'}); my $result = SOAP::Lite -> uri('http://authorization.xxxx.de/') -> proxy('http://user:passwd@xxxx.de/services/TradeLinkBMAuthorization') -> call($method => $logonData); if($result->fault) { print "Fault\n"; print join("\n", $result->faultcode, $result->faultstring); print "\n"; } else { print "TRUE\n"; print $result->result(); print "\n"; }
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
POST /services/TradeLinkBMAuthorization HTTP/1.0
User-Agent: Wget/1.9.1
Host: xxxx.de
Accept: */*
Connection: Keep-Alive
Authorization: Basic dmZsddddddVzc2lh
Content-Type: application/x-www-form-urlencoded
Content-Length: 485
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<logon xmlns="http://authorization.xxxx.de/">
<TMWLogonReq>
<password xsi:type="xsd:string">0359e686d1887ig28dka176013295fe2c</password>
<username xsi:type="xsd:string">user</uuername>
<version xsi:type="xsd:int">100</version>
</TMWLogonReq>
</logon>
</soap:Body>
</soap:Envelope>
HTTP/1.1 500 Internal Server Error
Date: Mon, 04 Aug 2008 09:48:29 GMT
Server: Jetty(6.1.9)
Content-Type: text/xml; charset=utf-8
Content-Length: 311
Connection: close
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Found element {http://authorization.xxxx.de/}TMWLogonReq but could not find matching RPC/Literal part</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
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
POST /services/TradeLinkBMAuthorization HTTP/1.0
User-Agent: Wget/1.9.1
Host: xxxx.de
Accept: */*
Connection: Keep-Alive
Authorization: Basic dmddddddzc2lh
Content-Type: application/x-www-form-urlencoded
Content-Length: 494
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns:logon xmlns:ns="http://authorization.xxxx.de/">
<TMWLogonReq>
<password xsi:type="xsd:string">0359e686d188chdefc7176013295fe2c</password>
<username xsi:type="xsd:string">user</username>
<version xsi:type="xsd:int">100</version>
</TMWLogonReq>
</ns:logon>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Date: Mon, 04 Aug 2008 09:51:59 GMT
Server: Jetty(6.1.9)
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 716
Connection: close
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:logonResponse xmlns:ns1="http://authorization.xxxx.de/">
<return>
<branchIDObjectList>
<branchID>FTX</branchID>
</branchIDObjectList>
<branchIDObjectList>
<branchID>CSO</branchID>
</branchIDObjectList>
<branchIDObjectList>
<branchID>DBK</branchID>
</branchIDObjectList>
<branchIDObjectList>
<branchID>ETR</branchID>
</branchIDObjectList>
<code>0</code>
<sessionID>E89D6FA76B57B1ADBD4B9474CFDB88C9BF28B0DF</sessionID>
<userActionObject>
<adminSystemAllowed>false</adminSystemAllowed>
<adminUserAllowed>true</adminUserAllowed>
<tradeAllowed>true</tradeAllowed>
</userActionObject>
</return>
</ns1:logonResponse>
</soap:Body>
</soap:Envelope>
1
2
my $method = SOAP::Data->name('ns:logon')
->attr({'xmlns:ns' => 'http://authorization.xxxx.de/'});
sechbeutel+2008-08-04 13:57:29--Hmmm. Im nachhinein komm ich mir schon etwas b.loed vor :-)
Mit folgendem Methodenaufruf gehts:
Code: (dl )1
2my $method = SOAP::Data->name('ns:logon')
->attr({'xmlns:ns' => 'http://authorization.xxxx.de/'});
Aber manchmal sieht man den Wald vor lauter Baeumen nicht.
Danke Renee.
4 Einträge, 1 Seite |