Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

XML RPC Frontier::Client...unknown RPC type?

by inblosam (Monk)
on Jan 31, 2005 at 05:05 UTC ( [id://426499]=perlquestion: print w/replies, xml ) Need Help??

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

I have been using Frontier::Client for almost a year now on one of my sites for accessing a service. It has worked great up until this morning when it decided to stop working. I have tried a bunch of things, and it seems that it is going through but I am just not able to harvest the information returned. When I turn debug => 1 I have the response printed out. I also get this (debug on or off):

unknown RPC type `br'
at line 1 column 0

There are also a few "warnings" in the debug text...see bottom of this post for that. So I figure I am not capturing the data right somehow, and I need some help.

Here is the code for my request:
#!/usr/bin/perl -w use strict; use Frontier::Client; my $server_url = 'http://vendorserver.com/service.php'; my $server = Frontier::Client->new('url' => $server_url, 'encoding' => + 'ISO-8859-1', 'debug' => 0); my @params = { 'tot-bed-lo' => '1', 'page' => '1', 'state' => 'ut', 'city' => 'Somecity', 'report-type' => 'long', 'method' => 'searchres', 'price-hi' => '950000', 'home-type' => [ '1' ], 'price-lo' => '100000', 'sort-by' => 'price asc', 'zip' => [ '55555', '55554' ], 'dev-tag' => '12345', 'report-struct' => 'all', 'tot-bath-lo' => '1' } ; my $result = $server->call('searchres', @params); use Data::Dumper; print Dumper(\$result);
So I am perplexed why this would suddenly stop working, and I can't figure out how to get the same data from the debug STDOUT in a variable. Any ideas??

THANKS!

And here is a clip of the debug output:
request ---- <?xml version="1.0" encoding="ISO-8859-1"?> <methodCall> <methodName>searchres</methodName> <params> <param><value><struct> <member><name>home-type</name><value><array><data> <value><i4>1</i4></value></data></array></value> </member> <member><name>price-lo</name><value><i4>100000</i4></value></member> <member><name>page</name><value><i4>1</i4></value></member> <member><name>tot-bed-lo</name><value><i4>1</i4></value></member> <member><name>sort-by</name><value><string>price asc</string></value>< +/member> <member><name>state</name><value><string>ut</string></value></member> <member><name>zip</name><value><array><data> <value><i4>55555</i4></value><value><i4>55554</i4></value></data></arr +ay></value> </member> <member><name>city</name><value><string>Somecity</string></value></mem +ber> <member><name>dev-tag</name><value><string>12345</string></value></mem +ber> <member><name>report-type</name><value><string>long</string></value></ +member> <member><name>report-struct</name><value><string>all</string></value>< +/member> <member><name>method</name><value><string>searchres</string></value></ +member> <member><name>tot-bath-lo</name><value><i4>1</i4></value></member> <member><name>price-hi</name><value><i4>950000</i4></value></member> </struct></value> </param> </params> </methodCall> ---- response ---- <br /> <b>Warning</b>: htmlspecialchars() expects parameter 1 to be string, +array given in <b>/web/xml/include/helper.inc</b> on line <b>242</b>< +br /> ... (a bunch of these warnings, that's from their server) ... <br /> <b>Warning</b>: htmlspecialchars() expects parameter 1 to be string, +array given in <b>/web/xml/include/helper.inc</b> on line <b>242</b>< +br /> <br /> <b>Warning</b>: Cannot modify header information - headers already se +nt by (output started at /web/xml/include/helper.inc:242) in <b>/web/ +xml/htdocs/service.php</b> on line <b>71</b><br /> <?xml version="1.0" encoding="iso-8859-1"?> <methodResponse> <params> <param> <value> <array> <data> <value> <int>327</int> </value> <value> <int>1</int> </value> <value> <int>33</int> </value> <value> <double>0.272385</double> </value>


Michael Jensen

Replies are listed 'Best First'.
Re: XML RPC Frontier::Client...unknown RPC type?
by !1 (Hermit) on Jan 31, 2005 at 06:14 UTC

    Sounds like a problem on their end. There is a function in php called htmlspecialchars. Perhaps it's time to submit a bug report?

    If you're looking to fix it on your end you can either edit Frontier::Client's call method or create a proxy that filters the php error messages. A solution for the former looks something like this:

    # in sub call replace # my $content = $response->content; # with this (my $content = $response->content) =~ s/.*?(?=<\?xml)//s;
      I just submitted the error. I suppose that the error could be causing my client to just exit when it encounters that in the message???

      Any easy way to capture the debug text (shows up in the terminal so I could just get that, strip off the errors, etc)?


      Michael Jensen
        They fixed it! :) Glad it was their fault not mine. Thanks for the advice!


        Michael Jensen

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://426499]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2024-04-19 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found