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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

OData data from within JSP code?

rleir
17-Peridot

OData data from within JSP code?

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
HelesicPetr
21-Topaz II
(To:rleir)

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

View solution in original post

5 REPLIES 5
HelesicPetr
21-Topaz II
(To:rleir)

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

rleir
17-Peridot
(To:HelesicPetr)

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

Thanks for your insight Petr

HelesicPetr
21-Topaz II
(To:rleir)

Hi @rleir 

It is simple

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

 PetrH

rleir
17-Peridot
(To:HelesicPetr)

Petr, tell more about your import 

"cz.aveng.AVWPublish.AVPublishConfigure"

It would be your company's product, but I did not see it on the web site.  Can you tell more please?

 

Just to be clear, I have a user running some JSP (so they are currently logged in) and I want the JSP to get data from OData without having to re-authenticate. 

And there is likely a better way to get access to the data, but this way I can re-use an algorithm based on accesses to OData.

HelesicPetr
21-Topaz II
(To:rleir)

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

Top Tags