I’m using this library myself in another project (will post about later) and am quite satisfied with how it works. Overall I’ve had a lot of fun writing this library and it helped me get to know reflect package much better. However, given the nature of this package and what it makes possible to do - I do not see this as a drawback. This means quite a bit of reflection is used behind the scenes. I’ve taken inspiration from both net/rpc/jsonrpc as well as encoding/json and encoding/xml packages when writing encoder & decoder for the wire format. The endpoint for Bugzilla WebServices is the xmlrpc.cgi script in your Bugzilla installation. I’ve decided to base the Client API on rpc.Client from net/rpc. If there are any mismatches between response XML and provided data type, library will return an appropriate error such as type 'SomeType' cannot be assigned a value of type 'string'. Server response is decoded into result struct. As this method accepts no arguments, second paramter to Call is nil.
The small code above will make an XML-RPC call to Mozilla’s Bugzilla API and request an RPC method Bugzilla.version. Package main import ( "fmt" "alexejk.io/go-xmlrpc" ) func main () In this code, we are defining the interface and providing the URL to our Bugzilla installation (XmlRpcUrl. Here is the basic and super simple interface for getting a bug out of Bugzilla using the Bug.get interface. To use this library, one must naturally add it to the project: The way the xmlrpcnet packages work is by setting up and interface that then is turned into a proxy for the XML-RPC service. Results of my tinkering around is alexejk.io/go-xmlrpc library ( Github). It should be possible to use pointers in both method arguments and method responses.Responses should be decodable to native Go data-types.It should support handling all data structures that XML-RPC spec supports.It should provide a Client with a simple interface to make RPC calls.
Designįor this client library, I had a few requirements for how I would want this library to work: This got me thinking: XML-RPC in it’s nutshell is very simple, and it should be fairly easy to make a library to support my needs (and it’s a fun project).Īnd so I set off to create yet another http router XML-RPC client library for Go.
My search results did reveal a few options, but they were no longer maintained and had somewhat quirky APIs.
I was not very surprised that there was hardly any information or projects that would support XML-RPC in Go, especially given how ancient XML-RPC actually is. After checking my calendar and ensuring that I did not go back to ‘98, I’ve set of in my search. 273 package Bugzilla ::XMLRPC ::Serializer 274 275 use 5.14.0 276 use strict 277 use warnings 278 279 use Scalar ::Util qw(blessed reftype) 280 # We can't use "use parent" because XMLRPC::Serializer doesn't return 281 # a true value.While working on one of my smaller projects I came across a need to make XML-RPC requests. 7 8 package Bugzilla ::WebService ::Server ::XMLRPC 9 10 use 5.14.0 11 use strict 12 use warnings 13 14 use XMLRPC ::Transport ::HTTP 15 use Bugzilla ::WebService ::Server 16 if ( $ENV 268 269 1 270 271 # This package exists to fix a UTF-8 bug in SOAP::Lite. 4 # 5 # This Source Code Form is "Incompatible With Secondary Licenses", as 6 # defined by the Mozilla Public License, v. If a copy of the MPL was not distributed with this 3 # file, You can obtain one at.
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option.Īlternatively you can here view or download the uninterpreted source code file.įor more information about "XMLRPC.pm" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 5.0.4_vs_5.0.6.ġ # This Source Code Form is subject to the terms of the Mozilla Public 2 # License, v.