Re: [Dev] [IoTS] Questions about how to authenticate user and request data from IoTS

2016-07-14 Thread 云展智创
I have solved the problem. please miss the mail.

--
Zhanwen Zhou (Jason), General Manager
+86 13922218435
zhanwen.z...@smartcloudex.com
Guangzhou Smart Cloudex Technology Co., Ltd.
Business: IOT, API

On Jul 13, 2016, at 3:53 PM, 云展智创  wrote:

> Thanks.
> 
> For the first question, if I call the api https:// IP>:9443/dynamic-client-web/register/ with curl or RESTClient, I can get the 
> client id and secret. But if I call it with ajax or xmlhttprequest, I got the 
> following errors:
> ——
> threw an 
> exception\n\torg.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\nroot
>  cause java.lang.NoSuchMethodError: 
> javax.ws.rs.InternalServerErrorException.validate(Ljavax/ws/rs/core/Response;Ljavax/ws/rs/core/Response$Status;)Ljavax/ws/rs/core/Response;\n\tjavax.ws.rs.InternalServerErrorException.init(InternalServerErrorException.java:92)\n\torg.apache.cxf.jaxrs.utils.SpecExceptions.toInternalServerErrorException(SpecExceptions.java:77)\n\torg.apache.cxf.jaxrs.utils.ExceptionUtils.toInternalServerErrorException(ExceptionUtils.java:110)\n\torg.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.convertExceptionToResponseIfPossible(JAXRSInInterceptor.java:267)\n\torg.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:256)\n\torg.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:88)\n\torg.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)\n\torg.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)\n\torg.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:249)\n\torg.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:248)\n\torg.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:222)\n\torg.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:153)\n\torg.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)\n\torg.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:289)\n\torg.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:209)\n\tjavax.servlet.http.HttpServlet.service(HttpServlet.java:646)\n\torg.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:265)\n\torg.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\nnote
>  The full stack trace of the root cause is available in the Apache 
> Tomcat/7.0.59 logs.Apache 
> Tomcat/7.0.59","responseXML":null,"responseType":"","response":"Apache
>  Tomcat/7.0.59 - Error report 
> HTTP Status 500 - Servlet execution threw an 
> exceptiontype Exception 
> reportmessage Servlet execution threw an 
> exceptiondescription The server encountered an internal 
> error that prevented it from fulfilling this 
> request.exception javax.servlet.ServletException: 
> Servlet execution threw an 
> exception\n\torg.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\nroot
>  cause java.lang.NoSuchMethodError: 
> 

Re: [Dev] [IoTS] Questions about how to authenticate user and request data from IoTS

2016-07-13 Thread 云展智创
Thanks.

For the first question, if I call the api https://:9443/dynamic-client-web/register/ with curl or RESTClient, I can get the 
client id and secret. But if I call it with ajax or xmlhttprequest, I got the 
following errors:
——
threw an 
exception\n\torg.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\nroot
 cause java.lang.NoSuchMethodError: 
javax.ws.rs.InternalServerErrorException.validate(Ljavax/ws/rs/core/Response;Ljavax/ws/rs/core/Response$Status;)Ljavax/ws/rs/core/Response;\n\tjavax.ws.rs.InternalServerErrorException.init(InternalServerErrorException.java:92)\n\torg.apache.cxf.jaxrs.utils.SpecExceptions.toInternalServerErrorException(SpecExceptions.java:77)\n\torg.apache.cxf.jaxrs.utils.ExceptionUtils.toInternalServerErrorException(ExceptionUtils.java:110)\n\torg.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.convertExceptionToResponseIfPossible(JAXRSInInterceptor.java:267)\n\torg.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:256)\n\torg.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:88)\n\torg.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)\n\torg.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)\n\torg.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:249)\n\torg.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:248)\n\torg.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:222)\n\torg.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:153)\n\torg.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)\n\torg.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:289)\n\torg.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:209)\n\tjavax.servlet.http.HttpServlet.service(HttpServlet.java:646)\n\torg.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:265)\n\torg.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\nnote
 The full stack trace of the root cause is available in the Apache 
Tomcat/7.0.59 logs.Apache 
Tomcat/7.0.59","responseXML":null,"responseType":"","response":"Apache
 Tomcat/7.0.59 - Error report 
HTTP Status 500 - Servlet execution threw an exceptiontype Exception 
reportmessage Servlet execution threw an 
exceptiondescription The server encountered an internal 
error that prevented it from fulfilling this 
request.exception javax.servlet.ServletException: 
Servlet execution threw an 
exception\n\torg.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\nroot
 cause java.lang.NoSuchMethodError: 

[Dev] [IoTS] Questions about how to authenticate user and request data from IoTS

2016-07-12 Thread 云展智创
Hi all,

I am writing a HTML5 mobile app to use with IoTS. I use an open source H5 
framework called MUI, which support ajax and xmlhttprequest. Could you tell me 
how to authenticate the user with IoTS and request data with the access token? 
I tried to use ajax call to https://:9443/dynamic-client-web/register/but failed. I don’t know if it is because 
of cross domain request. Could you give me some example?

Besides the device_mgt API in the following website[1], are there any API I can 
use to get data from IoTS devices and show in my app. 

Thanks.

[1] https://docs.wso2.com/display/iots100/apidocs/index.html#guide
--
Zhanwen Zhou (Jason), General Manager
+86 13922218435
zhanwen.z...@smartcloudex.com
Guangzhou Smart Cloudex Technology Co., Ltd.
Business: IOT, APIM___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev