cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

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

NP_10570407
11-Garnet

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

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

ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

6 REPLIES 6

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

Hi @HelesicPetr 

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

Thanks in advance.

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

Hi @HelesicPetr 

Thanks for the reply.

I want to pass an input parameter(for example a file path value) to the remote java class via the below http address. 

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

 

How can i do this?

 

Thanks in advance.

Hi @NP_10570407 

 

I used example how to pass the parameters in the HTTP

"?IBA=123456&VALUE=0000"

This is how you can pass parameters to the class.,

You just need to read it in your custom class from http request. 

 

PetrH

Yes. It works. Thank a ton @HelesicPetr for your help

Announcements

Top Tags