PDA

View Full Version : Web service client in CPAN ?



erland
2006-12-09, 03:46
Is there some web service client library available in the CPAN included in slimserver ?

I've tried the RPC::XML::Client which looked like it might work, but it doesn't work with my Java web service. I just get an error about missing SOAPAction header.

SOAP::Lite works perfectly but it isn't available in the slimserver CPAN.

At the moment I'm thinking about including SOAP::Lite with the plugin, but thought I'd check first if someone knows a better way.

So, Is there some other way I can call a web service from a slimserver plugin ?

erland
2006-12-12, 09:52
Is there some web service client library available in the CPAN included in slimserver ?

I've tried the RPC::XML::Client which looked like it might work, but it doesn't work with my Java web service. I just get an error about missing SOAPAction header.

SOAP::Lite works perfectly but it isn't available in the slimserver CPAN.

At the moment I'm thinking about including SOAP::Lite with the plugin, but thought I'd check first if someone knows a better way.

So, Is there some other way I can call a web service from a slimserver plugin ?
Does anyone have any clues about this ?

andyg
2006-12-12, 10:20
On Dec 12, 2006, at 11:52 AM, erland wrote:

>
> erland;160978 Wrote:
>> Is there some web service client library available in the CPAN
>> included
>> in slimserver ?
>>
>> I've tried the RPC::XML::Client which looked like it might work,
>> but it
>> doesn't work with my Java web service. I just get an error about
>> missing
>> SOAPAction header.
>>
>> SOAP::Lite works perfectly but it isn't available in the slimserver
>> CPAN.
>>
>> At the moment I'm thinking about including SOAP::Lite with the
>> plugin,
>> but thought I'd check first if someone knows a better way.
>>
>> So, Is there some other way I can call a web service from a
>> slimserver
>> plugin ?
> Does anyone have any clues about this ?

Well, first off, RPC::XML is for XML-RPC, and SOAP::Lite is for
SOAP. If you also control the server-side, you should probably avoid
SOAP, it's bloated, slow, and SOAP::Lite is a huge mess.

XML-RPC is so-so, but still overkill for most things. You are
probably better off using simple JSON.

As for what's already included with SlimServer, RPC::XML and
JSON::Syck are both included. SOAP::Lite is not and never will be.

erland
2006-12-12, 12:21
Well, first off, RPC::XML is for XML-RPC, and SOAP::Lite is for
SOAP. If you also control the server-side, you should probably avoid
SOAP, it's bloated, slow, and SOAP::Lite is a huge mess.

XML-RPC is so-so, but still overkill for most things. You are
probably better off using simple JSON.

As for what's already included with SlimServer, RPC::XML and
JSON::Syck are both included. SOAP::Lite is not and never will be.I do control the server side, but the library I am using now doesn't seem to support XML-RPC so I would like to avoid to rewrite something that actually works. I also think the web services will be used from other applications which already have SOAP support implemented.

Is there any risk that it would cause problems with other parts of slimserver if I included SOAP::Lite with the plugin. The plugin would just append its SOAP::Lite directory to @INC at initialization time and use client part of SOAP::Lite. It seems to work in my own setup, but if you see any problem with this I would appreciate any thoughts.

andyg
2006-12-12, 12:26
On Dec 12, 2006, at 2:21 PM, erland wrote:

>
> Andy Grundman;161820 Wrote:
>> Well, first off, RPC::XML is for XML-RPC, and SOAP::Lite is for
>> SOAP. If you also control the server-side, you should probably avoid
>>
>> SOAP, it's bloated, slow, and SOAP::Lite is a huge mess.
>>
>> XML-RPC is so-so, but still overkill for most things. You are
>> probably better off using simple JSON.
>>
>> As for what's already included with SlimServer, RPC::XML and
>> JSON::Syck are both included. SOAP::Lite is not and never will
>> be.I do control the server side, but the library I am using now
>> doesn't
> seem to support XML-RPC so I would like to avoid to rewrite something
> that actually works. I also think the web services will be used from
> other applications which already have SOAP support implemented.
>
> Is there any risk that it would cause problems with other parts of
> slimserver if I included SOAP::Lite with the plugin. The plugin would
> just append its SOAP::Lite directory to @INC at initialization time
> and
> use client part of SOAP::Lite. It seems to work in my own setup,
> but if
> you see any problem with this I would appreciate any thoughts.

It will work but will block SlimServer while it makes HTTP requests.
If this is acceptable to you, then go for it. :)