Worklight - 使用URL从非Worklight应用程序调用推送通知适配器

时间:2013-02-15 19:52:54

标签: websphere push-notification ibm-mobilefirst

我去年发布了一个问题并收到了link

的解决方案

在适配器XML中添加安全性测试wl_unprotected的解决方案适用于WL服务器5.0.0.3。

但是,在最近使用Websphere Server 8.5升级到5.0.0.5之后,我们在使用直接URL调用调用WL适配器时收到身份验证错误。

网址:

http://IPAddress:9080/worklight/invoke?adapter=MyPushNotificationAdapter&procedure=submitNotification&parameters=['user1','id1','1']

响应:

/*-secure-
{"isSuccessful":false,"warnings":[],"errors":["Work Light Authentication: null"],"info":[]}*/

即使我们从适配器XML中删除wl_unprotected安全测试,错误仍然存​​在。请建议使用WL 5.0.0.5 Enterprise Edition服务器中的URL直接调用适配器的解决方案。

2 个答案:

答案 0 :(得分:1)

将securityTest =“wl_unprotected”添加到适配器过程仍应在5.0.5中工作。

我刚刚通过创建一个新的Worklight 5.0.5项目,混合应用和适配器来测试它。默认情况下,创建的默认适配器有2个过程,getStories和getStoriesFiltered。

我将securityTest =“wl_unprotected”添加到适配器XML文件中的getStories过程,但是将其从getStoriesFiltered过程中删除。然后我构建了适配器并将其部署到在WebSphere Liberty上运行的5.0.5 Worklight服务器。

当我使用curl调用getStoriesFiltered过程(没有securityTest =“wl_unprotected”)时,调用失败并出现了您所描述的相同错误。

但是当我调用getStories过程(具有securityTest =“wl_unprotected”)时,它就成功了。

作为参考,这里是描述使用“wl_unprotected”securityTest的技术说明:http://www-01.ibm.com/support/docview.wss?uid=swg21612594

答案 1 :(得分:1)

在PushNotification适配器过程中调用了另一个适配器过程。在我将“wl_unprotected”安全性测试添加到第二个适配器过程之后,Push通知的URL调用开始工作。谢谢 !