diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2012-02-15 16:59:08 +0100 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2012-02-15 16:59:08 +0100 |
commit | 3d4edc9bd64bf54e5c8de528904a428d30503f3a (patch) | |
tree | 4900703cc75f09da280eb537ee155fe9ebc803a7 /Bugzilla | |
parent | 0081744381d7f56b4d41f1cdce4bf2c6e3991967 (diff) | |
download | bugzilla-3d4edc9bd64bf54e5c8de528904a428d30503f3a.tar.gz bugzilla-3d4edc9bd64bf54e5c8de528904a428d30503f3a.tar.xz |
Bug 724464 - JSON-RPC support shouldn't require SOAP::Lite
r/a=LpSolit
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/WebService.pm | 20 | ||||
-rw-r--r-- | Bugzilla/WebService/Server/XMLRPC.pm | 14 |
2 files changed, 14 insertions, 20 deletions
diff --git a/Bugzilla/WebService.pm b/Bugzilla/WebService.pm index fe9c3fe09..166707626 100644 --- a/Bugzilla/WebService.pm +++ b/Bugzilla/WebService.pm @@ -21,8 +21,6 @@ package Bugzilla::WebService; use strict; use Bugzilla::WebService::Server; -use XMLRPC::Lite; - # Used by the JSON-RPC server to convert incoming date fields apprpriately. use constant DATE_FIELDS => {}; # Used by the JSON-RPC server to convert incoming base64 fields appropriately. @@ -40,24 +38,6 @@ sub login_exempt { return $class->LOGIN_EXEMPT->{$method}; } -sub type { - my ($self, $type, $value) = @_; - if ($type eq 'dateTime') { - $value = $self->datetime_format_outbound($value); - } - return XMLRPC::Data->type($type)->value($value); -} - -# This is the XML-RPC implementation, see the README in Bugzilla/WebService/. -# Our "base" implementation is in Bugzilla::WebService::Server. -sub datetime_format_outbound { - my $self = shift; - my $value = Bugzilla::WebService::Server->datetime_format_outbound(@_); - # XML-RPC uses an ISO-8601 format that doesn't have any hyphens. - $value =~ s/-//g; - return $value; -} - 1; __END__ diff --git a/Bugzilla/WebService/Server/XMLRPC.pm b/Bugzilla/WebService/Server/XMLRPC.pm index b74d0eebd..5c3677993 100644 --- a/Bugzilla/WebService/Server/XMLRPC.pm +++ b/Bugzilla/WebService/Server/XMLRPC.pm @@ -31,6 +31,20 @@ if ($ENV{MOD_PERL}) { use Bugzilla::WebService::Constants; +# Allow WebService methods to call XMLRPC::Lite's type method directly +BEGIN { + *Bugzilla::WebService::type = sub { + my ($self, $type, $value) = @_; + if ($type eq 'dateTime') { + # This is the XML-RPC implementation, see the README in Bugzilla/WebService/. + # Our "base" implementation is in Bugzilla::WebService::Server. + $value = Bugzilla::WebService::Server->datetime_format_outbound($value); + $value =~ s/-//g; + } + return XMLRPC::Data->type($type)->value($value); + }; +} + sub initialize { my $self = shift; my %retval = $self->SUPER::initialize(@_); |