Wroof has asked for the wisdom of the Perl Monks concerning the following question:
Good morning Monks
I have been trying to write a client to access a soap server for a job and am very new to Perl and SOAP. I have been given the following information from the server and need to write a client for it. If someone use their vast knowledge to help me access the first function then I am sure I can take the rest :)
SOAP 1.1 HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <getCardInfoResponse xmlns="http://www.designa.de/"> <getCardInfoResult> <AmountPayed>int</AmountPayed> <AmountDue>int</AmountDue> <AmountDueCurrency>decimal</AmountDueCurrency> <AmountDuePeriodStart>dateTime</AmountDuePeriodStart> <AmountDuePeriodEnd>dateTime</AmountDuePeriodEnd> <CardUID>guid</CardUID> <ISONumber>string</ISONumber> <CardType>int</CardType> <CarparkUID>guid</CarparkUID> <CarparkNr>int</CarparkNr> <CodingTime>dateTime</CodingTime> <LastTccNumber>int</LastTccNumber> <LastTccTime>dateTime</LastTccTime> <NumberOfPayments>int</NumberOfPayments> <GracePeriod>int</GracePeriod> <VAT>int</VAT> <MoneyConversionFactor>decimal</MoneyConversionFactor> <Currency>string</Currency> <Cheater>boolean</Cheater> <RabattInfo> <Wert>int</Wert> <Zeit>int</Zeit> <Promille>int</Promille> <PromilleGeb>int</PromilleGeb> <GID>int</GID> <NullUntil>int</NullUntil> <CaOrder>string</CaOrder> <WertVerr>int</WertVerr> <ZeitVerr>int</ZeitVerr> <RabattBetragAbsolut>int</RabattBetragAbsolut> </RabattInfo> </getCardInfoResult> </getCardInfoResponse> </soap:Body> </soap:Envelope> SOAP 1.2 HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <getCardInfoResponse xmlns="http://www.designa.de/"> <getCardInfoResult> <AmountPayed>int</AmountPayed> <AmountDue>int</AmountDue> <AmountDueCurrency>decimal</AmountDueCurrency> <AmountDuePeriodStart>dateTime</AmountDuePeriodStart> <AmountDuePeriodEnd>dateTime</AmountDuePeriodEnd> <CardUID>guid</CardUID> <ISONumber>string</ISONumber> <CardType>int</CardType> <CarparkUID>guid</CarparkUID> <CarparkNr>int</CarparkNr> <CodingTime>dateTime</CodingTime> <LastTccNumber>int</LastTccNumber> <LastTccTime>dateTime</LastTccTime> <NumberOfPayments>int</NumberOfPayments> <GracePeriod>int</GracePeriod> <VAT>int</VAT> <MoneyConversionFactor>decimal</MoneyConversionFactor> <Currency>string</Currency> <Cheater>boolean</Cheater> <RabattInfo> <Wert>int</Wert> <Zeit>int</Zeit> <Promille>int</Promille> <PromilleGeb>int</PromilleGeb> <GID>int</GID> <NullUntil>int</NullUntil> <CaOrder>string</CaOrder> <WertVerr>int</WertVerr> <ZeitVerr>int</ZeitVerr> <RabattBetragAbsolut>int</RabattBetragAbsolut> </RabattInfo> </getCardInfoResult> </getCardInfoResponse> </soap12:Body> </soap12:Envelope> HTTP POST HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <CardInfo xmlns="http://www.designa.de/"> <AmountPayed>int</AmountPayed> <AmountDue>int</AmountDue> <AmountDueCurrency>decimal</AmountDueCurrency> <AmountDuePeriodStart>dateTime</AmountDuePeriodStart> <AmountDuePeriodEnd>dateTime</AmountDuePeriodEnd> <CardUID>guid</CardUID> <ISONumber>string</ISONumber> <CardType>int</CardType> <CarparkUID>guid</CarparkUID> <CarparkNr>int</CarparkNr> <CodingTime>dateTime</CodingTime> <LastTccNumber>int</LastTccNumber> <LastTccTime>dateTime</LastTccTime> <NumberOfPayments>int</NumberOfPayments> <GracePeriod>int</GracePeriod> <VAT>int</VAT> <MoneyConversionFactor>decimal</MoneyConversionFactor> <Currency>string</Currency> <Cheater>boolean</Cheater> <RabattInfo> <Wert>int</Wert> <Zeit>int</Zeit> <Promille>int</Promille> <PromilleGeb>int</PromilleGeb> <GID>int</GID> <NullUntil>int</NullUntil> <CaOrder>string</CaOrder> <WertVerr>int</WertVerr> <ZeitVerr>int</ZeitVerr> <RabattBetragAbsolut>int</RabattBetragAbsolut> </RabattInfo> </CardInfo>
So far I have not even been able to create the most basic connection using Perl and am a complete loss as to what to do next. Below is my code to call the method isAlive that the server also has.
my ($isbn_number) = @ARGV; use SOAP::Lite +autodispatch=> uri=>'http://www.designa.de/', outputxml=>1, proxy=>'http://192.168.1.100/AbacusWebService/ServiceCashPoint.a +smx'; my $isbn_xml = isAlive(); print "$isbn_xml\n";
As you can probably tell I have modified this from an example. Below is the output I get
Use of inherited AUTOLOAD for non-method main::isAlive() is deprecate +d at C:\Use rs\Sam\Documents\Perl code\soap.pl line 15. <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http: +//schemas. xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchem +a-instance " xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault> +<faultcode >soap:Client</faultcode><faultstring>Server did not recognize the valu +e of HTTP Header SOAPAction: http://www.designa.de/#isAlive.</faultstring><detai +l /></soap :Fault></soap:Body></soap:Envelope> Press any key to continue . . .
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: SOAP::LITE client help
by Khen1950fx (Canon) on May 01, 2014 at 04:24 UTC | |
by Wroof (Novice) on May 01, 2014 at 22:57 UTC | |
by Khen1950fx (Canon) on May 02, 2014 at 00:07 UTC | |
Re: SOAP::LITE client help
by Anonymous Monk on May 01, 2014 at 02:35 UTC | |
Re: SOAP::LITE client help
by Wroof (Novice) on May 02, 2014 at 01:28 UTC | |
by Anonymous Monk on May 02, 2014 at 07:22 UTC |
Back to
Seekers of Perl Wisdom