The bitcoin server need to be properly configured in order to accept RPC commands.
1. Locate your
bitcoin.conf file (
https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File, if it's not there just go ahead and create it) and add these lines:
rpcuser = MyRpcUsername
rpcpassword = MyRpcPassword
server = 1Since you will be hitting a server outside your LAN you also need to add the
rpcallowip = YourClientsIpHere parameter to your bitcoin.conf.
2. Run
bitcoind (or simply run the Qt client)
3. Use an RPC library of your choice to connect to the RPC server.
For example, using
BitcoinLib the script you need to generate a new address is:
IBitcoinService BitcoinService = new BitcoinService();
String newAddress = BitcoinService.GetNewAddress();