How can I connect to bitcoin-qt client with public ip address
You need to forward the port if you're in a LAN.

You need to add the IP of the server who is making the JSON-RPC call to the bitcoin.config file such as below:

rpcallowip= IPMakingTheRequest