Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hello I am working on the Requirement where I would required to call the Windchill API out side the Windchill system does anybody know this how we can achieve this.
e.g.: I have developed a code which create a WTDocument in Windchill now I want to call this code from out side the Windchill server.with in the company network
Solved! Go to Solution.
Create an Info Engine task with Apply-Service webject inside. That IE task can be called with http(s) request.
Create an Info Engine task with Apply-Service webject inside. That IE task can be called with http(s) request.
Thanks Yogesh,
I will try this at my end
You could also expose your function as a web service. Using an Info Engine task is much easier (in my opinion) if you've never worked with the Windchill Web Service framework.
Thanks Jamie,
Would you have any example for that, I am bit new in that so it will help me to do that
This PTC case links to the Web Service Framework documentation:
https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS47545
Thank you Yogesh I am able to call the Windchill API using Apply-Service but each time when I call the API through the browser I can not get the group value which contains the object information is it any way I can call it to ?
I am calling the webject from the my java application by calling the URL
http://host.domain/Windchill/servlet/IE/tasks/ext/company/object/createDocument.xml
when It execute it pop up the browser window with the output but I can not get the Windchill object
Apply-Service webject will returns object(s) returned by (Java) method it calls in turn (if its not void). You can use those objects by casting from "Object" to appropriate class. If you provide a few screenshots, I can be more specific.
Hello Yogesh,
Basically I am new in Info*engines so I am pretty not sure how this can be achieved so I have call it in that way
first I call the webject xml using this method
String url_open ="http://hostname/Windchill/servlet/IE/tasks/ext/swc/object/createDocument.xml";
java.awt.Desktop.getDesktop().browse(java.net.URI.create(url_open));
once the code is execute it open the file in the browser but since I have open it in through the url I am not able to get the group object
this is my webject task:
<%@page language="java"%>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>
<ie:webject name="Get-Properties" type="MGT">
<ie:param name="ATTRIBUTE" data="wt.federation.ie.VMName"/>
<ie:param name="GROUP_OUT" data="properties"/>
</ie:webject>
<ie:webject name="Query-Objects" type="OBJ">
<ie:param name="INSTANCE" data="$(properties[0]wt.federation.ie.VMName[0])"/>
<ie:param name="TYPE" data="wt.inf.container.WTContainer"/>
<ie:param name="WHERE" data="name=Swc_Product"/>
<ie:param name="GROUP_OUT" data="container"/>
</ie:webject>
<ie:webject name="Create-Objects" type="ACT">
<ie:param name="INSTANCE" data="$(properties[0]wt.federation.ie.VMName[0])"/>
<ie:param name="CONTAINER_REF" data="$(container[0]obid[0])"/>
<ie:param name="TYPE" data="wt.doc.WTDocument|com.swc.CustomDocument"/>
<ie:param name="FIELD" data="name=new_Document003"/>
</ie:webject>
From your post above, it sounds like you have a Java code that calls an IE task (different from my understanding that you are calling Java code via Apply-Service webject). Can you explain what you are trying to achieve?
So basically I have my application which is developed in java and which collect the Documents from the file server and load it to Windchill using Info*engine webject task
if your Java code is on same server as Windchill, following will help you.
https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS18364
And if you want to go IE task approach, use attached IE task
1. In IE task FileUpload.xml, replace "GOLF_CART" container name with product name where this file needs to be uploaded. Or you can parametrize it.
2. Place IE task FileUpload.xml in <Windchill>\tasks\ext\company\object\
3. Restart Windchill
4. Call this IE Task (tested on Windchill 9.1) from Java (supplying Document Name as parameter) and stream required content file. You will need to handle authentication.
http://host.domain/Windchill/servlet/IE/tasks/ext/company/object/FileUpload.xml?file=<Document Name>
Thank you Yogesh,
This will help me.