summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2002-07-16 03:47:34 +0000
committerivan <ivan>2002-07-16 03:47:34 +0000
commit46b6aae489f468a46be6c66f8ae6da48b41fe70c (patch)
tree2f41ea8b46ef95263500bc419d7a8b06f6e341ae
parent0393935877eebdd5bc0932d5ba0ef030bc46d167 (diff)
fix XML-RPC weirdness
-rw-r--r--FS/FS/part_export/infostreet.pm19
1 files changed, 17 insertions, 2 deletions
diff --git a/FS/FS/part_export/infostreet.pm b/FS/FS/part_export/infostreet.pm
index 2464e5dee..fbf58bd60 100644
--- a/FS/FS/part_export/infostreet.pm
+++ b/FS/FS/part_export/infostreet.pm
@@ -145,7 +145,7 @@ sub infostreet_setContact {
'getAccountID', $username);
foreach my $field ( keys %contact_info ) {
infostreet_command($url, $is_username, $is_password, $groupID,
- 'setContactField', $accountID, $field, $contact_info{$field} );
+ 'setContactField', [ 'int'=>$accountID ], $field, $contact_info{$field} );
}
}
@@ -165,6 +165,13 @@ sub infostreet_command { #subroutine, not method
eval "use Frontier::Client;";
+ eval 'sub Frontier::RPC2::String::repr {
+ my $self = shift
+ my $value = $$self;
+ $value =~ s/([&<>\"])/$Frontier::RPC2::char_entities{$1}/ge;
+ $value;
+ }';
+
my $conn = Frontier::Client->new( url => $url );
my $key_result = $conn->call( 'authenticate', $username, $password, $groupID);
my %key_result = _infostreet_parse($key_result);
@@ -172,7 +179,15 @@ sub infostreet_command { #subroutine, not method
my $key = $key_result{data};
#my $result = $conn->call($method, $key, @args);
- my $result = $conn->call($method, $key, map { $conn->string($_) } @args);
+ my $result = $conn->call( $method, $key,
+ map {
+ if ( ref($_) ) {
+ my( $type, $value) = @{$_};
+ $conn->$type($value);
+ } else {
+ $conn->string($_);
+ }
+ } @args );
my %result = _infostreet_parse($result);
die $result{error} unless $result{success};