alien_life_form has asked for the wisdom of the Perl Monks concerning the following question:

Greetings.
Is anybody aware of a (sort of) standard way to deal with webservices that return ADO.Net datasets?
What I've come up with so far (with SOAP::Lite) is unspeakably ugly (to these eyes, at least):
my $lite= new SOAP::Lite ->uri($uri) ->proxy($proxy) ->on_action(sub { sprintf ('%s/%s',@_);}) ->deserializer(SOAP::Custom::XML::Deserializer->new) # later... $result=$lite->call($method=>@params); # $result contains an ADO.Net d +ataset my $ds=$result->valueof('//NewDataSet'); my @rows=$ds->value(); my $nr=scalar(@rows); my $res="Records:$nr\n"; return unless $nr > 0; my @headers=map {$_->{_name}} ($rows[0]->value()); $res .= join(",",@headers). "\n"; foreach my $val (@rows) { $res .= join(',',($val->value())) . "\n"; }
I've been looking all over and the best hint I got (from which the above code is derived) is from this URL: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsoap/html/soapliteperl.asp.

It would appear that the perl community has forgotten about ADO.Net datasets altogether...


Cheers,
alf
You can't have everything: where would you put it?

Replies are listed 'Best First'.
Re: ADO.Net datasets through SOAP::Lite (or generally perl)
by tbone1 (Monsignor) on Apr 23, 2004 at 13:16 UTC
    Is anybody aware of a (sort of) standard way to deal with webservices that return ADO.Net datasets?

    One coworker suggested 'dealing with it' by using a rifle. And he's a Microsoftie, no less.

    --
    tbone1, YAPS (Yet Another Perl Schlub)
    And remember, if he succeeds, so what.
    - Chick McGee

Re: ADO.Net datasets through SOAP::Lite (or generally perl)
by alien_life_form (Pilgrim) on Apr 26, 2004 at 09:02 UTC
    Phew.
    This doesn't do much increase my liking of the webservices bandwagon....
    • Interoperability appears to be poor to sorry, not to mention wrapped in thick layers of hard to understand issues of RPC vs. literal encoding.

    • Calling a method requires all the parameters to be named (that's OK) and in a given order (way less than OK in my book)

    • The field is already strewn with horribly complex message formats (e.g. ADO.Net datasets) that force you to either reinvent client side behavior OR to use a Microsoft client. (How is this supposed to be good? Document/literal advocates in the "webservices are about document based messaging, not RPC" field say it is, but this forced separation of data and behaviour looks a gigantic leap backwards to me)
    Ok, I got it off my chest. Now let the flamethrowers be unsheathed.

    Cheers,
    alf
    You can't have everything: where would you put it?
Re: ADO.Net datasets through SOAP::Lite (or generally perl)
by Anonymous Monk on Apr 23, 2004 at 19:13 UTC
    Is anybody aware of a (sort of) standard way to deal with webservices that return ADO.Net datasets?
    A "standard way"? I'd way what you have is standard, but more importantly, what you have works. As for being ugly, yes, your perl style style (if you can call it style) is ugly, but no uglier than SOAP.
    It would appear that the perl community has forgotten about ADO.Net datasets altogether...
    Why would you say that? You have a perfectly good way of dealing with them...