SOAP::Lite "service" examples

Discussion in 'Perl Misc' started by xhoster@gmail.com, Aug 3, 2007.

  1. Guest

    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
     
    , Aug 3, 2007
    #1
    1. Advertising

  2. Ian Wilson Guest

    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.
     
    Ian Wilson, Aug 3, 2007
    #2
    1. Advertising

  3. Guest

    "John" <> wrote:
    > <> wrote in message
    > news:20070802215906.104$...
    > > 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::Data->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
     
    , Aug 3, 2007
    #3
  4. -berlin.de Guest

    <> wrote in comp.lang.perl.misc:

    [...]

    > Isolating around the problem, starting at line 3003:
    >
    > foreach (@{$services->{$service}{parameters}}) {
    > # next unless $_;
    > $self->{'_stub'} .= " SOAP::Data->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
     
    -berlin.de, Aug 9, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Aaron Brady

    SQL, lite lite lite

    Aaron Brady, Dec 29, 2008, in forum: Python
    Replies:
    15
    Views:
    761
    Aaron Brady
    Jan 1, 2009
  2. Replies:
    0
    Views:
    292
  3. Gary W. Smith

    Web Service randomly hangs when being called from SOAP::Lite

    Gary W. Smith, Aug 4, 2009, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    905
    Gary W. Smith
    Aug 4, 2009
  4. JGH
    Replies:
    1
    Views:
    402
  5. droesler
    Replies:
    2
    Views:
    513
    droesler
    Aug 31, 2010
Loading...

Share This Page