Thank you very much – it definitely helped!
Looking at the plugin, I managed to successfully call getRoomHash in order to log in to rooms. But right now I am creating rooms, whenever I want to login to one (with add – which causes several rooms with the same name). Instead I would prefer using the getExternal method in the RoomWebService – but I am not sure how to send the RoomDTO as a query parameter – I tried several ways and none worked so far. (I would get an internal server error like seen in the attachment (500 an error occurred while parsing the query filter ….)) Would you mind sending me an example call to the getExternal Rest Endpoint? As far as I know there is no general way of accepting DTOs as a query parameter, especially when there are 2 ( for example this is definitely not the right way to call ?sid=sid&room=name=…) so I would highly appreciate an example in order to see how to send the sid and the room dto as query parameters. Thanks in advance! Cheers Andre Von: Maxim Solodovnik [mailto:[email protected]] Gesendet: Friday, August 26, 2016 8:02 AM An: Openmeetings user-list <[email protected]> Betreff: Re: Cannot reproduce REST API example This is why I have created PHP API [1] :))) I guess you need to take a look at this [2] line It will not work if both params will be encoded [1] https://github.com/openmeetings/openmeetings-api-plugin [2] https://github.com/openmeetings/openmeetings-api-plugin/blob/master/src/main/scripts/OmGateway.php#L97 On Fri, Aug 26, 2016 at 3:00 AM, Andre Wruszczak <[email protected] <mailto:[email protected]> > wrote: Dear Openmeetings-Team! Thank you for submitting the REST API Sample on your homepage! I am currently struggling with reproducing the ajax call shown in the sample with php. My url is pretty much this = http://localhost:5080/openmeetings/services/user/hash?sid=SOMEVALIDSID I am preparing the data like this : $user = array( 'firstname' => 'John', 'lastname' => 'Doe', 'externalId' => 'uid1', 'externalType' => 'myCMS', 'login' => 'superjohn'); $roomOptions = array( 'roomId' => 5, 'moderator' => true, 'showAudioVideoTest' => true); $data = json_encode(array('user' => $user, 'options' => $roomOptions), JSON_FORCE_OBJECT); And curl it like this : $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_RETURNTRANSFER => 1, CURLOPT_POST => 1, CURLOPT_POSTFIELDS => $data, CURLOPT_URL => $url, CURLOPT_USERAGENT => 'Reproducing’, CURLOPT_SSLVERSION => 3, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => 0 ]); I tried it many times with different versions of the data etc. and I always get either (415 unsupported media type) or (500 Internal Server Error) without any (at least for me) helpful further informations. I have included one of the error.html. I would really appreciate some help at this stage. Maybe I should send the request with the “wadl” in the url? Thanks in advance, -Andre -- WBR Maxim aka solomaxTitle: Apache Tomcat/8.0.36 - Error report
HTTP Status 500 - An error occurred while parsing the query filter "select r from Room as r where r.externalId = :externalId AND c.externalType = :externalType AND r.type = :type AND c.deleted = false". Error message: Attempt to query field "c.externalType" from non-entity variable "c". Perhaps you forgot to prefix the path in question with an identification variable from your FROM clause?
type Exception report
message An error occurred while parsing the query filter "select r from Room as r where r.externalId = :externalId AND c.externalType = :externalType AND r.type = :type AND c.deleted = false". Error message: Attempt to query field "c.externalType" from non-entity variable "c". Perhaps you forgot to prefix the path in question with an identification variable from your FROM clause?
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.cxf.interceptor.Fault: An error occurred while parsing the query filter "select r from Room as r where r.externalId = :externalId AND c.externalType = :externalType AND r.type = :type AND c.deleted = false". Error message: Attempt to query field "c.externalType" from non-entity variable "c". Perhaps you forgot to prefix the path in question with an identification variable from your FROM clause? org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162) org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128) org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189) org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99) org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254) org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180) org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299) org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:223) javax.servlet.http.HttpServlet.service(HttpServlet.java:622) org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:274) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:174) org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:284) org.red5.logging.LoggerContextFilter.doFilter(LoggerContextFilter.java:84)
root cause
org.apache.openmeetings.webservice.error.ServiceException: An error occurred while parsing the query filter "select r from Room as r where r.externalId = :externalId AND c.externalType = :externalType AND r.type = :type AND c.deleted = false". Error message: Attempt to query field "c.externalType" from non-entity variable "c". Perhaps you forgot to prefix the path in question with an identification variable from your FROM clause? org.apache.openmeetings.webservice.RoomWebService.getExternal(RoomWebService.java:193) sun.reflect.GeneratedMethodAccessor142.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180) org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189) org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99) org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254) org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180) org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299) org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:223) javax.servlet.http.HttpServlet.service(HttpServlet.java:622) org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:274) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:174) org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:284) org.red5.logging.LoggerContextFilter.doFilter(LoggerContextFilter.java:84)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.36 logs.
