Skip to main content
12-Amethyst
January 3, 2024
Solved

How can I invoke/run the custom Windchill class from a .bat file on remote machine?

  • January 3, 2024
  • 1 reply
  • 1940 views

How can I invoke/run the custom Windchill class(deployed in Windchill home directory) from a batch file(.bat) in another (remote) machine?

Best answer by HelesicPetr

Hi @NP_10570407 

Google can help you to find how to call http in cmd

https://medium.com/@dwyer.donovan/sending-http-requests-from-your-command-line-5ef6eecffb0a

 

Example of a class that can be run from HTTP

package cz.HELT;

public class Test1 implements RemoteAccess
{
public static void ProjectsTest(HTTPRequest req, HTTPResponse resp) throws WTException
{
// run your code
}
)

http address to call your class

http://server/Windchill/servlet/WindchillAuthGW/cz.HELT.Test1/ProjectsTest?IBA=123456&VALUE=0000

 

PetrH

1 reply

HelesicPetr
22-Sapphire II
22-Sapphire II
January 3, 2024

Hi @NP_10570407 

Use http request to run your code from another machine. 

I don't think you can do it without calling http request. 

You can run the java class from local cmd with correct configuration but outside that machine it seams like you would like to hack the windchill >D

PetrH

12-Amethyst
January 3, 2024

Hi @HelesicPetr 

If possible, could you please provide me with a sample code.

Thanks in advance.

HelesicPetr
22-Sapphire II
22-Sapphire II
January 3, 2024

Hi @NP_10570407 

Google can help you to find how to call http in cmd

https://medium.com/@dwyer.donovan/sending-http-requests-from-your-command-line-5ef6eecffb0a

 

Example of a class that can be run from HTTP

package cz.HELT;

public class Test1 implements RemoteAccess
{
public static void ProjectsTest(HTTPRequest req, HTTPResponse resp) throws WTException
{
// run your code
}
)

http address to call your class

http://server/Windchill/servlet/WindchillAuthGW/cz.HELT.Test1/ProjectsTest?IBA=123456&VALUE=0000

 

PetrH