IBM MobileFirst:检查HTTP适配器到后端流量 [英] IBM MobileFirst: inspecting the HTTP adapter to back-end traffic

查看:92
本文介绍了IBM MobileFirst:检查HTTP适配器到后端流量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从部署在MobileFirst Development Server中的HTTP适配器到达后端,并在响应中显示一些意外结果。



后端位于我控制并使用HTTPS,因此使用 wireshark 检查后端日志或流量不是我的选择。



我希望能够检查传出的标题。有没有办法做到这一点?

解决方案

Worklight Server到后端

我认为最简单的方法是在检查时切换到HTTP(假设它不是生产时间),或者将证书添加到Wireshark以便能够检查网络流量,即使它在HTTPS中< / p>

设备到Worklight服务器
假设您的请求也不是通过HTTPS发送的,我相信您可以看到所有已发送的标头Chrome的DevTools中的网络选项卡。



根据您的Worklight版本,您可能看不到任何查询。

在这种情况下,您可以在最底层的initOptions.js中添加以下内容,然后再试一次(但请注意,这是不受支持的,可能会随着任何版本的更改而改变提到 - 仅用于此调试会话以查看网络选项卡日志中的查询。)

  WL.androidProfileData [WL.EPField.SUPPORT_WL_NATIVE_XHR] = false; 
WL.iphoneProfileData [WL.EPField.SUPPORT_WL_NATIVE_XHR] = false;
WL.ipadProfileData [WL.EPField.SUPPORT_WL_NATIVE_XHR] = false;
WL.windowsphone8ProfileData [WL.EPField.SUPPORT_WL_NATIVE_XHR] = false;

但如果你在所有端点使用HTTPS,它可能没有帮助...考虑更改为HTTP在开发应用程序时?


I am reaching a back-end from an HTTP adapter deployed in the MobileFirst Development Server with some unexpected results in the responses.

The back-end is outside of my control and uses HTTPS, so inspecting the back-end logs or the traffic with wireshark is not a option for me.

I'd like to be able to inspect the outgoing headers. Is there some way to do this?

解决方案

Worklight Server to Backend
I think that easiest would be to switch to HTTP for the time of inspection (assuming it's not production-time), or to add a certificate to Wireshark in order to be able to inspect the network traffic even though it's in HTTPS

Device to Worklight Server Assuming your request is not being sent via HTTPS as well, I believe you can see all sent headers in the Network tab inside Chrome's DevTools.

Depending on your Worklight version you may not see any of the queries being done.
In that case you could add the following in initOptions.js at the very bottom, and try again (but do note that this is unsupported and could change with any release w/out prior mentioning - use it only for the sake of this debugging session to see the queries in the Network tab log).

WL.androidProfileData[WL.EPField.SUPPORT_WL_NATIVE_XHR] = false;
WL.iphoneProfileData[WL.EPField.SUPPORT_WL_NATIVE_XHR] = false;
WL.ipadProfileData[WL.EPField.SUPPORT_WL_NATIVE_XHR] = false;
WL.windowsphone8ProfileData[WL.EPField.SUPPORT_WL_NATIVE_XHR] = false;

But if you're using HTTPS in all endpoints it might not help... consider changing to HTTP while developing the app?

这篇关于IBM MobileFirst:检查HTTP适配器到后端流量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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