Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > SOAP::Lite "service" examples

Reply
Thread Tools

SOAP::Lite "service" examples

 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      08-03-2007
I'm having trouble getting SOAP::Lite "service" method to work properly.
All of the examples I've seen point to wsdl's that are either not found
or just give no response.

http://www.xmethods.net/sd/StockQuoteService.wsdl
http://svc.perl.org/Svc.wsdl

Does anyone have a working example of how to make a call with SOAP::Lite
service which uses a working, publicly available SOAP server?

Also, I haven't been impressed with my experience with SOAP::Lite. When I
try to use it on our internal wsdls I get inscrutable errors, where other
language's SOAP support seems to work fine. Is there something else
designed to make SOAP easy to use that I might want to try? (SOAP::WSDL
uses SOAP::Lite under the hood, so I suspect it will have the same problem.
It refuses to install with cpan under a non-privileged user, so I haven't
yet tested it directly. Trying to fix that will be the next step, unless I
get good suggestions here.)

Thanks,

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
 
Reply With Quote
 
 
 
 
Ian Wilson
Guest
Posts: n/a
 
      08-03-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> I'm having trouble getting SOAP::Lite "service" method to work properly.
> All of the examples I've seen point to wsdl's that are either not found
> or just give no response.
>
> http://www.xmethods.net/sd/StockQuoteService.wsdl
> http://svc.perl.org/Svc.wsdl
>
> Does anyone have a working example of how to make a call with SOAP::Lite
> service which uses a working, publicly available SOAP server?


Public services seem to be somewhat ephemeral.

It isn't hard to make a trivial SOAP::Lite service of your own, use
POD::WSDL to create some WSDL for it and then consume that WSDL with a
SOAP::Lite client that uses the "service" method.

> Also, I haven't been impressed with my experience with SOAP::Lite. When I
> try to use it on our internal wsdls I get inscrutable errors, where other
> language's SOAP support seems to work fine. Is there something else
> designed to make SOAP easy to use that I might want to try? (SOAP::WSDL
> uses SOAP::Lite under the hood, so I suspect it will have the same problem.


SOAP::Lite is somewhat quirky and has poor support for any SOAP service
that isn't RPC/Encoded.

I haven't found anything better than SOAP::Lite. Actually, there doesn't
seem to be any significant competition.
 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      08-03-2007
"John" <(E-Mail Removed)> wrote:
> <(E-Mail Removed)> wrote in message
> news:20070802215906.104$(E-Mail Removed)...
> > I'm having trouble getting SOAP::Lite "service" method to work
> > properly. All of the examples I've seen point to wsdl's that are either
> > not found or just give no response.
> >
> > http://www.xmethods.net/sd/StockQuoteService.wsdl
> > http://svc.perl.org/Svc.wsdl
> >
> > Does anyone have a working example of how to make a call with
> > SOAP::Lite service which uses a working, publicly available SOAP
> > server?
> >
> > Also, I haven't been impressed with my experience with SOAP::Lite.
> > When I try to use it on our internal wsdls I get inscrutable errors,
> > where other language's SOAP support seems to work fine. Is there
> > something else designed to make SOAP easy to use that I might want to
> > try? (SOAP::WSDL uses SOAP::Lite under the hood, so I suspect it will
> > have the same problem.
> > It refuses to install with cpan under a non-privileged user, so I
> > haven't yet tested it directly. Trying to fix that will be the next
> > step, unless I
> > get good suggestions here.)
> >
> > Thanks,
> >
> > Xho
> >
> > --
> > -------------------- http://NewsReader.Com/ --------------------
> > Usenet Newsgroup Service $9.95/Month 30GB

>
> Hi
>
> I have been down this road before.
>
> Can you show us what you have already written?


I'm just using the client side, and unfortunately I don't think that
showing you that will do much good without also providing the whole
server side stuff, wsdl (which I have access to but would need to
go through obstructionist lawyers to show you) plus the implementation
(which I don't even have access to, or know what language it is in). Alas,
that is why I was hoping for an example using a publicly accessible
server--that way the client stuff would be meaningful to you, as we would
be using the same server.

Anyway, what I do is:

#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Lite service =>
'http://bioinf-dev07/services/foobaloo.asmx?wsdl';
print HelloWorldSimple();
__END__

Can't call method "name" without a package or object reference at
/tools/GNU/perl/5.8.7_64/lib/site_perl/5.8.7/SOAP/Lite.pm line 3005.
BEGIN failed--compilation aborted at soap.pl line 5.



I have SOAP::Lite version:

# $Id: Lite.pm,v 1.43 2006/08/16 14:49:34 byrnereese Exp $

Isolating around the problem, starting at line 3003:

foreach (@{$services->{$service}{parameters}}) {
# next unless $_;
$self->{'_stub'} .= " SOAP:ata->new(name => '".$_->name."',
type => '".$_->type."', attr => {";

So the commenting out of "next unless $_" allows truly empty $_ to reach
the following line, triggering the error. However, if I comment it back
in, then everything gets skipped, apparently because $_ is an object which
seems to have overloaded operations which cause it to evaluate as false in
this (stringification?) context. I changed the line to execute the "next"
on only the values of $_ which are true empty strings, rather than objects
with overloaded operations:

next if not ref $_ and not $_;

And that solves that particular error, but now nothing is printed in the
final line of my script. (In python and C# against the same WSDL/server,
HelloWorldSimple() does return a meaningful string)

Anyway, I will work on making a simplified WSDL and a Server to serve it,
that I can post both of.

Thanks,

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
 
Reply With Quote
 
anno4000@radom.zrz.tu-berlin.de
Guest
Posts: n/a
 
      08-09-2007
<(E-Mail Removed)> wrote in comp.lang.perl.misc:

[...]

> Isolating around the problem, starting at line 3003:
>
> foreach (@{$services->{$service}{parameters}}) {
> # next unless $_;
> $self->{'_stub'} .= " SOAP:ata->new(name => '".$_->name."',
> type => '".$_->type."', attr => {";
>
> So the commenting out of "next unless $_" allows truly empty $_ to reach
> the following line, triggering the error. However, if I comment it back
> in, then everything gets skipped, apparently because $_ is an object which
> seems to have overloaded operations which cause it to evaluate as false in
> this (stringification?) context.


Boolean. Overload generates a boolean value out of quite a few others,
most notably stringification. That often comes unexpected to the
programmer, as seems to be the case here.

> I changed the line to execute the "next"
> on only the values of $_ which are true empty strings, rather than objects
> with overloaded operations:
>
> next if not ref $_ and not $_;


If you can modify the "use overload" statement (I'm not quite clear
about what is where), adding

bool => sub { 1 },

would be an alternative. I'm not saying it's going to make a difference
but who knows. If there is a similar problem elsewhere it would be
fixed too.

Anno
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.Net Tips, C# Tips : Create a well formed URI using UriBuilder classwith C# Examples and VB.Net Examples jayeshsorathia@gmail.com ASP .Net 1 07-31-2012 01:03 AM
RESUME EXAMPLES INFORMATION / CV EXAMPLES NOW AVAILABLE THROUGHRESUMEWRITERGUIDE.COM rawebadvert3 Computer Support 0 03-23-2008 04:19 AM
COVER LETTERS RESUME EXAMPLES AND CV EXAMPLES AVAILABLE CURRICULUM VITAE rawebadvert3 Computer Support 0 08-21-2007 03:07 AM
COVER LETTERS RESUME EXAMPLES AND CV EXAMPLES AVAILABLE rawebadvert3 Computer Support 0 05-25-2007 04:18 AM



Advertisments