... it is in a different machine. I can use Tomcat Manager to deploy the web service but I would like to do it from java code with http PUT request.
In order for that to be possible, the deployment folder would need to be accessible from the HTTP server or web application. That's generally a bad idea for security reasons.
You can still do it programmatically with Java (or other language) by calling any of the many utilities for file transfers: ftp, scp, networked file system, etc.
Note that after you have copied the artifact (eg war file) to the Tomcat host, you can then tell Tomcat to deploy it remotely via the deployment manager url. From the documentation:
In this example the web application located in the directory /path/to/foo on the Tomcat server is deployed as the web application context named /footoo.
http://localhost:8080/manager/text/deploy?path=/footoo&war=file:/path/to/foo
In this example the ".war" file /path/to/bar.war on the Tomcat server is deployed as the web application context named /bar. Notice that there is no path parameter so the context path defaults to the name of the web application archive file without the ".war" extension.
http://localhost:8080/manager/text/deploy?war=jar:file:/path/to/bar.war!/
Your code could copy the artifact via scp (or whatever) and if successful call the manager URL with appropriate arguments. A two step process in a single code run.