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

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.

Comment on
Trouble getting started with SOAP (SOAP::Lite, SOAP::WSDL), translating from PHP to Perl
Select or Download CodeReplies are listed 'Best First'.

SOAP itself looks to be simple enough, looking like a variant of XML (which for me is quite familiar). But, it is the communication between the client and server which doesn't seem so simple. For example, it looks like the core problem I have with the WSDL file for which I have the URL, appears to be the use of complex data types. It is clear to me that the call I quoted from the working PHP script has created definitions of two classes, and that the second argument to SOAPClient is some kind of array with pointers or a map to the class definitions. I have not found anything that is obviously similar to that in Perl's various SOAP packages. Suppose I wanted to create a server and a client that handled peronal IDs and addresses, and started by creating a person class and an address class (with the peerson class having an address as a data member). How would I create the server to both receive such data and how would I write the client so that it knows about these classes? I don't know PHP that well, but I assume my perl SOAP client would not be able to connect to the server unless it includes the class definitions when it first tries to connect (mimicing what the PHP code seems to do). But then, the question is, how do I do that?