Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to get started writing a SOAP client, and it is proving difficult for two reasons. 1) The only working example I have for the SOAP sever I need to use is written in PHP, and it uses complex data types. 2) I don't have a SOAP server that I can use to test the Perl code I need to write.
I am having trouble finding the perl equivalent of the following PHP code
$soap = new SoapClient("https://the.soap.url/api/service?wsdl", array("classmap"=>array("Type1"=>"Type1", "Type2"=>"Type2")));The class definitions look similar to the following:
class Type1 { var $f11 = null; var $f12 = null; } class Type2 { var $f21 = null; var $f22 = null; var $f23 = null; }
The following perl code fails, I assume because it contains no information about the expected classes
my $soap = SOAP::Lite->service('https://the.soap.url/api/service/?wsdl');And to make it more challenging, I have not had the need to write my own Perl classes (though I write Java and C++ classes all the time, so the main ideas are not new to me).
I can read PHP well enough to understand what it is doing, but I have not written any of my own PHP code.
Far be it from me to recommend anything MS, but I found that the documentation they provid for their Visual Studio has a neat educational feature. For .NET, they have extensive examples, and you can select the langauge (VB, C#, &c.) at the top of the examples, so you can see how to do a given task in each fo the supported languages. This is a great help if you want to learn the langages well enough to translate code from one language to another. Can anyone recommend a site that facilitates seeing how PHP and Perl relate to each other (not so much an ontological relation, but rather how each does any given task).
As always, any guidance would be greatly appreciated.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Trouble getting started with SOAP (SOAP::Lite, SOAP::WSDL), translating from PHP to Perl
by Khen1950fx (Canon) on Feb 20, 2012 at 19:09 UTC | |
by Anonymous Monk on Feb 20, 2012 at 19:47 UTC | |
by tangent (Parson) on Feb 20, 2012 at 20:14 UTC | |
by Anonymous Monk on Feb 20, 2012 at 20:40 UTC | |
by tangent (Parson) on Feb 20, 2012 at 21:44 UTC | |
|