Abhishek
Abhishek

Reputation: 279

SOAP webservice: Python server and perl client

I have created a SOAP service (using spyne). I have used python on the server side. I have a python client that works perfectly fine. But, I want to reuse the output obtained from the server in a perl script (cannot use python). One possible way would be to call the python client from within perl and capture STDOUT. But, it would be nice if I could write a simple perl client to get the results. I wrote a simple perl client for SOAP following this, but my code did not print anything.

my $soap = SOAP::Lite->new();
my $service = $soap -> service($URL);
print Dumper($service -> serverFunction($arg1,$arg2));

Here I found a discussion about perl server and python client.

So, is it possible to have a python server and perl client?

Upvotes: 2

Views: 286

Answers (1)

Sebastian
Sebastian

Reputation: 2550

Yes, it is possible, but it's SOAP. See the notice from SOAP::Simple:

Let's face it. SOAP is painfull. It's a dumb idea, the only reason you should ever consider using SOAP is if someone holds a gun to your head or pay you a lot of money for it.

If you want to build an API and have both server and client under your control: Try to avoid SOAP whenever possible. Consider switching to a JSON or basic HTTP API.

If you want to keep SOAP, I suggest to try SOAP::Simple, it might work better than SOAP::Lite. There's also the SOAP module, but it's probably too heavy for your usage case.

PS: You might want to include more details (e.g. code you tried) in your question to get a more specific answer.

Upvotes: 1

Related Questions