I've been trying to search through examples and posts, but haven't been able to find a good example of how to transfer arbitrary data between server and agent. I'm looking for a way to perform two types of tasks:
1) Allow an agent to transfer data back to the server and trigger an arbitrary piece of Java code
2) Allow the server to trigger an arbitrary piece of Java code on the agent and return data
I believe XML RPC is probably the best approach to accomplish this, so I'm hoping there's a way to use the TeamCity XML RPC mechanism to accomplish these tasks. I'd prefer not to create an external XML RPC service because that opens up additional hassles such as additional firewall rules, user authentication, etc.
Here are some examples of the type of activity I'd like to do:
1) Upon execution of a build step: collect information on the build agent, send it back to the server (as XML?), and have the server execute some Java code to process that data (such as saving it to an external database). I don't want to use the logging framework to do this because the size and complexity of the data returned wouldn't lend itself well to simple log messages.
2) Create a TeamCity plug-in which adds admin functionality through the UI to invoke a command on the agent (such as an outbound network connection test) and return a result. This would allow an admin to remotely debug issues such as "Is this agent able to access a network resource."
Of the two examples, the first example is of primary interest to me. Are there any examples of this type of communication and remote code execution within any existing plug-ins?