Skip to main content
17-Peridot
February 12, 2024
Solved

OData data from within JSP code?

  • February 12, 2024
  • 1 reply
  • 2179 views

Team

Is it possible to GET OData data from within JSP code? Calling to some Java interface within WRS, so I can pass in some OData parameters and receive the Windchill data.

 

The JSP code is invoked after user authentication, so I would not want to be re-authenticating in the call to WRS.

 

Best answer by HelesicPetr

Hi @rleir 

The import is just example of my own class and how to call the method from JSP page. 

You can use any classes what you need from the Windchill. 

My class contains my own methods that do something.

 

If you call the ODATA from JSP you always need to authenticate even though the user session is logged in. 

The OData RestAPI are usually used outside the Windchill and it is designed for it. If you don't want to reauthenticate you need to use some SSO method same as from thingworx.  

 

PS: you can not retrieve a password from the user. It is not possible because it would be a security black hole. 

You can use universal user to authenticate for the Odata call. so you would have static user and psw that can be used from your own config. ...  

 

PetrH

1 reply

HelesicPetr
22-Sapphire II
22-Sapphire II
February 12, 2024

Hi @rleir 

I guess if you call RestApi you need to authenticate even though you call it from Windchill page. 

Someone can correct me. 

 

If I call rest api from thingworx that is set with Windchill wit SSO, if I call rest api, I need to authenticate the call. 

I may do something wrong but I have to do so.  

PetrH

rleir17-PeridotAuthor
17-Peridot
February 13, 2024

No, I am asking about a Java API callable from some JSP in the Windchill server.

Thanks for your insight Petr

HelesicPetr
22-Sapphire II
22-Sapphire II
February 13, 2024

Hi @rleir 

It is simple

<%@ page import="cz.aveng.AVWPublish.AVPublishConfigure" %>
<%
AVPublishConfigure.reloadConfigData();
%>

 PetrH