Menu

#5 Incorrect interpretation of method response.

open
nobody
None
5
2004-06-12
2004-06-12
Anonymous
No

Attached is an XML method response returned by a
service that dxmlrpc incorrectly interprets.

The method response contains a struct. This IRpcStruct
should contain the key "top_destinations_by_count", but
it doesn't, even though it is in the XML.

These are the keys it should contain when you call
IRpcStruct.KeyList:

average_call_duration
sum_duration_offpeak
count_calls_fixed
top_hours_by_count
count_calls_all
top_weekdays_by_count
sum_duration_peak
top_destinations_by_count
sum_duration_fixed
count_calls_offpeak
count_calls_unanswered
sum_duration_all
count_calls_peak
top_callers_by_count
sum_duration_mobile
top_originations_by_count
calls_per_day_of_month
count_calls_mobile

but these are the keys IRpcStruct.KeyList incorrectly
returns:

average_call_duration
sum_duration_offpeak
count_calls_fixed
top_hours_by_count
count_calls_all
top_weekdays_by_count
sum_duration_peak
COUNTRY_CODE <== error !!!
sum_duration_fixed
count_calls_offpeak
count_calls_unanswered
sum_duration_all
count_calls_peak
top_callers_by_count
sum_duration_mobile
top_originations_by_count
calls_per_day_of_month
count_calls_mobile

As you can see COUNTRY_CODE is incorrectly returned
as a key of that struct when COUNTRY_CODE is actually
a key of the nested struct that belongs to
top_destinations_by_count.

I hope this is clear.

Discussion

  • Nobody/Anonymous

    Valid XML method response that dxmlrpc doesn't interpret correctly.

     
  • Nobody/Anonymous

    Logged In: NO

    After further debugging I found that this problem is caused by
    the stream being read incorrectly somewhere in the Dxmlrpc
    +Indy... code. I don't know why, but when I use the Indy
    code standalone, they fetch the exact same test URL
    correctly. This is my test URL:
    http://mijn.belfabriek.nl/cgi-bin/idbug.cgi
    It'll allways return the exact same response not matter what
    you send it (try it for example in IE). If you try to let dxmlrpc
    call that URL (with some fake function), then you'll see how it
    incorrectly interprets the result.

    In the mean time I have no choice but to use pocketXMLRPC
    to meat my deadlines.

    It would be much nices if dxmlrpc wasn't fixed to the Indy
    code. Perhaps a mechanism of supplying dxmlrcp with callback
    functions would be better. That way users can determine
    which (http) transport code they want to use themselves. It
    also will make debugging easier.

     
  • Nobody/Anonymous

    Logged In: NO

    After further debugging I found that this problem is caused by
    the stream being read incorrectly somewhere in the Dxmlrpc
    +Indy... code. I don't know why, but when I use the Indy
    code standalone, they fetch the exact same test URL
    correctly. This is my test URL:
    http://mijn.belfabriek.nl/cgi-bin/idbug.cgi
    It'll allways return the exact same response not matter what
    you send it (try it for example in IE). If you try to let dxmlrpc
    call that URL (with some fake function), then you'll see how it
    incorrectly interprets the result.

    In the mean time I have no choice but to use pocketXMLRPC
    to meat my deadlines.

    It would be much nices if dxmlrpc wasn't fixed to the Indy
    code. Perhaps a mechanism of supplying dxmlrcp with callback
    functions would be better. That way users can determine
    which (http) transport code they want to use themselves. It
    also will make debugging easier.

     
  • Little Earth Solutions

    I found similar issue if my sending structure was:
    array -> string
    array -> struct -> array -> struct

    but fine if structure was:
    array -> string
    array -> struct
    array -> array -> struct

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.