]>
git.ipfire.org Git - thirdparty/bugzilla.git/blob - xmlrpc.cgi
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 # This Source Code Form is "Incompatible With Secondary Licenses", as
7 # defined by the Mozilla Public License, v. 2.0.
16 use Bugzilla
::Constants
;
18 use Bugzilla
::WebService
::Constants
;
21 if (!Bugzilla
->feature('xmlrpc')) {
22 ThrowUserError
('feature_disabled', {feature
=> 'xmlrpc'});
25 use Bugzilla
::WebService
::Server
::XMLRPC
;
27 Bugzilla
->usage_mode(USAGE_MODE_XMLRPC
);
29 # Fix the error code that SOAP::Lite uses for Perl errors.
30 local $SOAP::Constants
::FAULT_SERVER
;
31 $SOAP::Constants
::FAULT_SERVER
= ERROR_UNKNOWN_FATAL
;
33 # The line above is used, this one is ignored, but SOAP::Lite
34 # might start using this constant (the correct one) for XML-RPC someday.
35 local $XMLRPC::Constants
::FAULT_SERVER
;
36 $XMLRPC::Constants
::FAULT_SERVER
= ERROR_UNKNOWN_FATAL
;
38 local @INC = (bz_locations
()->{extensionsdir
}, @INC);
39 my $server = new Bugzilla
::WebService
::Server
::XMLRPC
;
41 # We use a sub for on_action because that gets us the info about what
42 # class is being called. Note that this is a hack--this is technically
43 # for setting SOAPAction, which isn't used by XML-RPC.
44 $server->on_action(sub { $server->handle_login(WS_DISPATCH
, @_) })->handle();