Thread Perl-Modul für SOAP (7 answers)
Opened by Aendy at 2011-06-18 21:33

Gast Aendy
 2011-06-19 09:47
#149748 #149748
Hallo bianca,

der Soap-Request sieht ungefähr so aus:
Code: (dl )
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
<?xml version="1.0" ?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<CheckForSoftwareUpdates>
<InstalledSoftware>
<SoftwareName>
SampleSoftware1
</SoftwareName>
<Version>
1.2.3
</Version>
<OperatingSystem>
Windows_XP
</OperatingSystem>
</InstalledSoftware>
<InstalledSoftware>
<SoftwareName>
SampleSoftware2
</SoftwareName>
<Version>
2.3.4
</Version>
<OperatingSystem>
Windows_XP
</OperatingSystem>
</InstalledSoftware>
</CheckForSoftwareUpdates>
</S:Body>
</S:Envelope>


Ich hab es bereits mit SOAP::Lite und einem WSDL-File probiert, allerdings hab ich es nicht geschafft das WSDL-File so anzupassen, dass die Struktur passt:
Code (perl): (dl )
1
2
3
4
5
6
7
8
#!perl -w

use SOAP::Lite;

my $service = SOAP::Lite
   -> service('http://192.168.0.214/update.wsdl');

my $test = $service->CheckForSoftwareUpdates('SampleSoftware1');


Code: (dl )
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
<?xml version ="1.0" ?>
<definitions name="StockQuote"
targetNamespace="http://example.org/StockQuote"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">

<message name="CheckForSoftwareUpdatesRequest">
<part name="InstalledSoftware" type=""/>
</message>
<message name="CheckForSoftwareUpdatesResponse">
<part name="Result" type=""/>
</message>

<portType name="StockQuotePortType">
<operation name="CheckForSoftwareUpdates">
<input message="tns:CheckForSoftwareUpdatesRequest"/>
<output message="tns:CheckForSoftwareUpdatesResponse"/>
</operation>
</portType>

<binding name="StockQuoteBinding" type="tns:StockQuotePortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="CheckForSoftwareUpdates">
<soap:operation soapAction="http://192.168.0.214/update/CheckForSoftwareUpdate"/>
<input>
<soap:body use="encoded" namespace="urn:xmethods-delayed-quotes"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:xmethods-delayed-quotes"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>

<service name="StockQuoteService">
<port name="StockQuotePort" binding="StockQuoteBinding">
<soap:address location="http://192.168.0.214/stockquote.php"/>
</port>
</service>
</definitions>



Da der Request schon fertig ist würde ich in am liebsten gleich so versenden.
Dann könnte ich mir das WSDL-File sparen.


Freue mich über jede Idee

Gruß
Aendy


Last edited: 2011-06-19 10:12:34 +0200 (CEST)

View full thread Perl-Modul für SOAP