gorilla-xmlrpc
gorilla-xmlrpc copied to clipboard
Pass on faults from methods.
This allows services to generate their own faults. eg
type HelloService struct{}
func (h *HelloService) Say(r *http.Request, args *struct{Who string}, reply *struct{Message string}) error {
log.Println("Say", args.Who)
if args.Who == "poop" {
return xml.Fault{
Code: 90,
String: "I refuse to say rude words!",
}
}
reply.Message = "Hello, " + args.Who + "!"
return nil
}