如何调用适配器的URL或链接 [英] How to invoke the url or link of an adapter

查看:124
本文介绍了如何调用适配器的URL或链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道如何从云中的开发服务器调用适配器。在本地环境中,我们可以在eclipse中选择,但是在云中的开发服务器中,我看不到调用的选项。

I need know how to invoke the adapter from the development server in the cloud. In the local environment we have the option in eclipse but in the development server in the cloud, I can´t see the option for invoking.

我使用MobileFirst 7.0

I use MobileFirst 7.0

更新 - 基于标签的通知未到达我的设备。

Update - The notification based in tags does not arrive to my device.

问题是在控制台中通知成功,但这些从未到达我的设备。这是我日志中的消息。

The problem is that in the console the notification is success, but these never arrive to my device. This is the message in my log.

[4/1/15 19:39:03:451 CDT] 00000081 ht.integration.js.JavaScriptIntegrationLibraryImplementation I Notificacion enviada exitosamente {"message":{"alert":"nacion"},"target":{"tagNames":["nacion"]},"settings":{"apns":{"sound":"57_dog-barking.mp3","payload":{"url":"nacion"}}}} [project ElUniversal]
[4/1/15 19:41:14:328 CDT] 0000013f ht.integration.js.JavaScriptIntegrationLibraryImplementation I Notificacion enviada exitosamente {"message":{"alert":"nacion"},"target":{"tagNames":["nacion"]},"settings":{"apns":{"sound":"57_dog-barking.mp3","payload":{"url":"nacion.com"}}}} [project ElUniversal]
[4/1/15 19:42:26:417 CDT] 000000cb ht.integration.js.JavaScriptIntegrationLibraryImplementation I Notificacion enviada exitosamente {"message":{"alert":"metropolitest"},"target":{"tagNames":["metropoli"]},"settings":{"apns":{"sound":"57_dog-barking.mp3","payload":{"url":"metropoliurl"}}}} [project ElUniversal]
[4/1/15 19:42:36:649 CDT] 00000118 ht.integration.js.JavaScriptIntegrationLibraryImplementation I Notificacion enviada exitosamente {"message":{"alert":"metropolitest"},"target":{"tagNames":["metropoli"]},"settings":{"apns":{"sound":"57_dog-barking.mp3","payload":{"url":"metropoliurl"}}}} [project ElUniversal]
[4/1/15 19:44:15:229 CDT] 000000d1 com.worklight.common.util.jmx.LibertyRuntimeMBeanHandler     I Establishing REST connection to service:jmx:rest://localhost:9443/IBMJMXConnectorREST
[4/1/15 19:45:03:448 CDT] 000001d7 ht.integration.js.JavaScriptIntegrationLibraryImplementation I Notificacion enviada exitosamente {"message":{"alert":"metropolitest"},"target":{"tagNames":["metropoli"]},"settings":{"apns":{"sound":"57_dog-barking.mp3","payload":{"url":"metropoliurl"}}}} [project ElUniversal]
[4/1/15 19:45:23:708 CDT] 00000036 ht.integration.js.JavaScriptIntegrationLibraryImplementation I Notificacion enviada exitosamente {"message":{"alert":"metropolitest"},"target":{"tagNames":["metropoli"]},"settings":{"apns":{"sound":"57_dog-barking.mp3","payload":{"url":"metropoliurl"}}}} [project ElUniversal]
[4/1/15 19:46:29:882 CDT] 000001e8 ht.integration.js.JavaScriptIntegrationLibraryImplementation I Notificacion enviada exitosamente {"message":{"alert":"deportestest"},"target":{"tagNames":["deportes"]},"settings":{"apns":{"sound":"57_dog-barking.mp3","payload":{"url":"deportesurl"}}}} [project ElUniversal]






在我的nativeApp中,与服务器的连接是正确的,这是输出的一部分:


In my nativeApp the connection to the server is correct and this is a part of the Output:

 2015-04-01 19:09:34.041 El_Universal_Demo[211:9844] [DEBUG] [WL_REQUEST] -[WLRequest sendRequest:path:withOptions:] in WLRequest.m:220 :: Sending request (http://198.11.212.196:9080/ElUniversal/apps/services/loguploader) with headers: 
{
"Accept-Language" = es;
"Content-Encoding" = gzip;
"Content-Type" = "application/json";
"User-Agent" = "El_Universal_Demo/1 (iPhone; iOS 8.1.2; Scale/2.00)/WLNativeAPI/7.0.0.0";
"X-Requested-With" = XMLHttpRequest;
"x-wl-app-version" = "1.0";
"x-wl-clientlog-appname" = "El_Universal_Demo";
"x-wl-clientlog-appversion" = "1.0";
"x-wl-clientlog-deviceId" = "A6042553-8580-4365-A69C-6731388D6A56";
"x-wl-clientlog-env" = iOSnative;
"x-wl-clientlog-model" = "iPhone6,1";
"x-wl-clientlog-osversion" = "8.1.2";
"x-wl-compressed" = true;
"x-wl-device-id" = "A6042553-8580-4365-A69C-6731388D6A56";
"x-wl-platform-version" = "7.0.0.0";
}
 You can see the request body in the Analytics platform logs.
 2015-04-01 19:09:34.081 El_Universal_Demo[211:9844] [DEBUG]    [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper start] in  WLAFHTTPClientWrapper.m:297 :: Starting the request with URL   http://198.11.212.196:9080/ElUniversal/apps/services/loguploader
 2015-04-01 19:09:34.085 El_Universal_Demo[211:9844] [DEBUG] [WL_REQUEST] __42-[WLRequest sendRequest:path:withOptions:]_block_invoke in WLRequest.m:230 :: waiting for response... (Thread=<NSThread: 0x170260f40>{number = 1, name = main})
 2015-04-01 19:09:34.187 El_Universal_Demo[211:9844] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:310 :: Request Success
 2015-04-01 19:09:34.193 El_Universal_Demo[211:9844] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:311 :: Response Status Code : 201
2015-04-01 19:09:34.199 El_Universal_Demo[211:9844] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:312 :: Response Content : 
2015-04-01 19:09:34.210 El_Universal_Demo[211:9844] [DEBUG] [WL_REQUEST] -[WLRequest requestFinished:] in WLRequest.m:361 :: Response Header: {
"Content-Language" = "en-US";
"Content-Length" = 0;
Date = "Thu, 02 Apr 2015 01:10:30 GMT";
P3P = "policyref=\"/w3c/p3p.xml\", CP=\"CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE\"";
"X-Powered-By" = "Servlet/3.0";
 }
 Response Data: 
  Status code=201
  2015-04-01 19:09:34.214 El_Universal_Demo[211:9844] [DEBUG] [WL_REQUEST] -[WLRequest requestFinished:] in WLRequest.m:404 :: NSS object is null
 2015-04-01 19:09:34.217 El_Universal_Demo[211:9844] [DEBUG] [OCLogger] Client Logs successfully sent to server.
 2015-04-01 19:09:34.269 El_Universal_Demo[211:9844] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:310 :: Request Success
2015-04-01 19:09:34.274 El_Universal_Demo[211:9844] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:311 :: Response Status Code : 201
  2015-04-01 19:09:34.279 El_Universal_Demo[211:9844] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:312 :: Response Content : 
 2015-04-01 19:09:34.290 El_Universal_Demo[211:9844] [DEBUG] [WL_REQUEST] -[WLRequest requestFinished:] in WLRequest.m:361 :: Response Header: {
"Content-Language" = "en-US";
"Content-Length" = 0;
Date = "Thu, 02 Apr 2015 01:10:30 GMT";
P3P = "policyref=\"/w3c/p3p.xml\", CP=\"CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE\"";
"X-Powered-By" = "Servlet/3.0";
}
Response Data: 
Status code=201
 2015-04-01 19:09:34.298 El_Universal_Demo[211:9844] [DEBUG] [WL_REQUEST] -[WLRequest requestFinished:] in WLRequest.m:404 :: NSS object is null
2015-04-01 19:09:34.304 El_Universal_Demo[211:9844] [DEBUG] [OCLogger] Analytics data successfully sent to server.






当我怀疑特定标签时,这是登录我的Xcode控制台。


When I suscribe to specific tag, this is the log in my console of Xcode.

2015-04-01 19:25:36.579 El_Universal_Demo[242:14249] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] +[WLAFHTTPClientWrapper requestWithURL:] in WLAFHTTPClientWrapper.m:46 :: Request url is http://198.11.212.196:9080/ElUniversal/apps/services/api/El_Universal_Demo/iOSnative/notifications
2015-04-01 19:25:36.586 El_Universal_Demo[242:14249] [DEBUG] [WL_REQUEST] -[WLRequest sendRequest:path:withOptions:] in WLRequest.m:141 :: Request timeout is 10.000000
2015-04-01 19:25:36.589 El_Universal_Demo[242:14249] [DEBUG] [WL_REQUEST] -[WLRequest sendRequest:path:withOptions:] in WLRequest.m:220 :: Sending request (http://198.11.212.196:9080/ElUniversal/apps/services/api/El_Universal_Demo/iOSnative/notifications) with headers: 
 {
"Accept-Language" = es;
"User-Agent" = "El_Universal_Demo/1 (iPhone; iOS 8.1.2; Scale/2.00)/WLNativeAPI/7.0.0.0";
"X-Requested-With" = XMLHttpRequest;
"x-wl-app-version" = "1.0";
"x-wl-device-id" = "A6042553-8580-4365-A69C-6731388D6A56";
"x-wl-platform-version" = "7.0.0.0";
}
 You can see the request body in the Analytics platform logs.
2015-04-01 19:25:36.596 El_Universal_Demo[242:14249] [DEBUG]  [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper start] in  WLAFHTTPClientWrapper.m:297 :: Starting the request with URL   http://198.11.212.196:9080/ElUniversal/apps/services/api/El_Universal_Demo/iOSnative/notifications
 2015-04-01 19:25:36.601 El_Universal_Demo[242:14249] [DEBUG] [WL_REQUEST] __42-[WLRequest sendRequest:path:withOptions:]_block_invoke in WLRequest.m:230 :: waiting for response... (Thread=<NSThread: 0x170064f00>{number = 1, name = main})
 2015-04-01 19:25:36.876 El_Universal_Demo[242:14249] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:310 :: Request Success
2015-04-01 19:25:36.881 El_Universal_Demo[242:14249] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:311 :: Response Status Code : 200
2015-04-01 19:25:36.886 El_Universal_Demo[242:14249] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:312 :: Response Content : /*-secure-
{"errors":[],"isSuccessful":true,"warnings":[],"info":[]}*/
2015-04-01 19:25:36.893 El_Universal_Demo[242:14249] [DEBUG] [WL_REQUEST] -[WLRequest requestFinished:] in WLRequest.m:361 :: Response Header: {
"Cache-Control" = "no-cache, no-store, must-revalidate";
"Content-Length" = 70;
"Content-Type" = "application/json; charset=UTF-8";
Date = "Thu, 02 Apr 2015 01:26:33 GMT";
Expires = "Thu, 01 Jan 1970 00:00:00 GMT";
P3P = "policyref=\"/w3c/p3p.xml\", CP=\"CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE\"";
Pragma = "no-cache";
"X-Powered-By" = "Servlet/3.0";
}
Response Data: /*-secure-
{"errors":[],"isSuccessful":true,"warnings":[],"info":[]}*/
Status code=200
2015-04-01 19:25:36.897 El_Universal_Demo[242:14249] [DEBUG] [WL_REQUEST] -[WLRequest requestFinished:] in WLRequest.m:404 :: NSS object is null
2015-04-01 19:25:36.899 El_Universal_Demo[242:14249] [DEBUG] [WL_PUSH] -[TagSubscribeRequestDelegate onSuccessWithResponse:userInfo:] in WLPush.m:132 ::    Successfully subscribed to tag tucartera
2015-04-01 19:25:36.904 El_Universal_Demo[242:14249] on Success Status: 0
InvocationResult: (null)
InvocationContext: (null)
Response text: /*-secure-
{"errors":[],"isSuccessful":true,"warnings":[],"info":[]}*/


推荐答案

要通过其端点调用适配器,只需向以下网址发出请求:

To invoke the adapter through their endpoint simply make a request to the following url:

http(s)://< server>:< port> /< project-name> / adapters /< adapter-name> /<过程名>

例如:

http: // localhost:10080 / MyProject / adapters / MyHttpAdapter / myRssFeed

在前面的示例中,我的MobileFirst服务器在<$ c $上运行c> localhost 在端口 10080 ,我有一个名为 MyProject 的项目和适配器 MyHttpAdapter ,函数 myRssFeed

In the previous example, my MobileFirst server is running on localhost at port 10080, I have a project called MyProject and adapter MyHttpAdapter with a function myRssFeed

在IBM MobileFirst Platform V7中。 0安全性基于OAuth模型,因此如果适配器受到保护,您将需要一个授权令牌来调用适配器。

In IBM MobileFirst Platform V7.0 security is based on the OAuth model so you are going to need an authorization token to invoke adapters if they are protected.

仅限开发环境,您可以获得测试授权令牌位于:

For DEVELOPMENT ENVIRONMENT ONLY you can get a test authorization token at:

http(s)://< server>:< port> /< project-name> / authorization / v1 / testtoken

要了解有关调用适配器的更多信息,请访问:
http://www-01.ibm.com/support/knowledgecenter/SSHSCD_7.0.0/com.ibm.worklight.dev.doc/devref/c_adapters_endpoint.html?lang=en

To learn more about invoking adapters visit: http://www-01.ibm.com/support/knowledgecenter/SSHSCD_7.0.0/com.ibm.worklight.dev.doc/devref/c_adapters_endpoint.html?lang=en

要了解有关OAuth测试令牌的更多信息,请访问:
http://www-01.ibm.com/support/knowledgecenter/SSHSCD_7.0.0/com.ibm.worklight .dev.doc / devref / c_oauth_test_token_endpoint.html?lang = en

To learn more about the OAuth test token visit: http://www-01.ibm.com/support/knowledgecenter/SSHSCD_7.0.0/com.ibm.worklight.dev.doc/devref/c_oauth_test_token_endpoint.html?lang=en

这篇关于如何调用适配器的URL或链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆