XML-RPC support in Go?

1,896 views
Skip to first unread message

Adam Jimerson

unread,
Mar 7, 2012, 3:48:23 PM3/7/12
to golang-nuts
Does anyone know if Go tip has support for XML-RPC?  I see there are two RPC packages in Go, one named RPC and one for JSONRPC.
I have a project that needs to be able to send XML-RPC requests to a server and handle the responses, I also apologize in advance for  
my lack of knowledge of RPC and XML-RPC I have a lot of specifications on it that I need to read through.  Due to the fact the client side
will have to send out multiples of such requests and handle what gets returned from the server I figured this would be a great use of Go's
concurrency.

Reading through the documentation on the RPC package it doesn't state what format that it uses or expects to use.  Would I have to use the
XML package and marshal the data then use RPC package to submit the data or does RPC package use XML in the first place?  Is this not possible
with the current packages for Go?  Any pointers on this subject to get me started in the right direction would be greatly appreciated.

Kyle Lemons

unread,
Mar 7, 2012, 4:32:10 PM3/7/12
to Adam Jimerson, golang-nuts
The net/rpc package natively uses gob.  The jsonrpc package implements one possible incarnation of jsonrpc (there are multiple).  There is no stdlib support for XML RPC, but it would be pretty trivial to add yourself.  If you want to see some example codec code other than the provided one for JSON, I have a protobuf client and server codec that you could look at.

Adam Jimerson

unread,
Mar 7, 2012, 4:54:12 PM3/7/12
to Kyle Lemons, golang-nuts
When you say "pretty trivial" you mean it would be pretty similar to the jsonrpc package?  I'm afraid I don't know enough of XML RPC to write a package to implement it in Go.

wkharold

unread,
Mar 7, 2012, 7:14:13 PM3/7/12
to golan...@googlegroups.com, Kyle Lemons

vendion

unread,
Mar 8, 2012, 6:39:24 AM3/8/12
to golang-nuts
Thank you for the link, I must have over looked that project on the
package dashboard.

On Mar 7, 7:14 pm, wkharold <wkhar...@gmail.com> wrote:
> http://code.google.com/p/go-xmlrpc/source/browse/xmlrpc/client.go

vendion

unread,
Mar 8, 2012, 12:41:53 PM3/8/12
to golan...@googlegroups.com, Kyle Lemons
Looking over the example the developer implemented their own rpc package (rpc2), not sure if it is to avoid the gob encoding or not, the package is pretty out of
date so I can't get it to build to test it.  Even after running go fix on all the source files, which corrected the import statements, when I try to build or install the packages,
both rpc2 and xmlrpc, I get this error:


go install xmlrpc.go 
go install: no install location for command-line-arguments

I am currently on go version weekly.2012-03-04 +5c664f190e4e

On Wednesday, March 7, 2012 7:14:13 PM UTC-5, wkharold wrote:
http://code.google.com/p/go-xmlrpc/source/browse/xmlrpc/client.go

Reply all
Reply to author
Forward
0 new messages