I am currently developing a proof of concept Blackberry application that uses RPC calls. I have also developed a very basic server application in .Net that simply timestamps a string sent to it and returns it to the client. I have been able to connect to the server app using a .Net client and a Java client so I am fairly confident it works correctly.
For the Blackberry client application I used Java Wireless Toolkit 2.5.2 to generate stubs for the RPC calls. I then used these calls in a basic Blackberry app to try and replicate the results of the .Net and Java clients, but it keeps throwing exceptions. I am not sure if I am using stubs correctly.
pushScreen(new HelloWorldScreen("Initiating communication"));
try {
IHelloService_Stub stub = new IHelloService_Stub();
String result = stub.hello("Hello From Blackberry");
pushScreen(new HelloWorldScreen(result));
} catch (RemoteException e) {
pushScreen(new HelloWorldScreen(e.getMessage()));
}
At present I am running everything locally. The server runs as localhost and the Blackberry app is running on the Blackberry simulator. I have used the Blackberry browser to check if I can reach the service and I can so its not the network connection that is the issue.
The exception thrown is the following:
java.io.interruptedIOException: Local connection timed out after ~ 120000
Try appending ;deviceside=true to your URL. That should eliminate the need for using the MDS simulator.
It appears that it matters where MDS is installed. I had originally installed in in C:\Program Files(x86)\Research in Motion but then read a post elsewhere that suggested installing it directly to C:\ . Amazingly, that did the trick and MDS now runs. For anyone else having MDS issues, here's a troubleshooting link:
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800792/801079/Support_-_BlackBerry_Mobile_Data_Service_Simulator_does_not_launch.html?nodeid=800979&vernum=0
Related
I Have an Electron app with a Webview. When i set the webview src to the website https://www.zap.co.il
i'm receiving the error: net:ERR_CONNECTION_RESET. The weird things are:
It's happening only for that website, i'm not receiving this error from any other website.
I'm able to reach the website from any other browser on my computer (Chrome, Chromium).
This is happening in both Windows and Mac platforms.
A colleague of mine have the same App installed on her computer, and she is experiencing the same behaviour from a different computer (and network)
There is no antivirus Installed that may intercept and no proxy configured. I have tried to reset the network, clear cache and cookies, change the MTU and basically any solution i found on the internet, and since it's happening for my colleague too, i suppose it has nothing to do with a network issues.
And since i can reach the website from other browsers, I think the issue is probably relates to Electron.
I'm Using the versions:
electron: 8.2.1
electron-builder: 22.4.1
The problem was that electron add's few properties to the user agent string. and this specific website is not accepting custom properties in the user agent (probably for security reasons). I fixed it by removing the additional properties from the webview's user agent:
webview.addEventListener('dom-ready', () => {
const uaArr = webview.getUserAgent().split(" ");
const newUaArr = uaArr.filter((uar => !uar.startsWith('Electron')));
webview.setUserAgent(newUaArr.join(" "));
});
I am using TNetHttpRequest and TNetHTTPClient to send post data to API url like this:
Params := TMultiPartFormData.Create;
Params.AddFile('file_upload', 'c:\myfile.txt','application/octet-stream');
NetHTTPRequest1.Post('https://myurl.com', Params);
This work fin on Windows 10 but on new Windows 7 Home edition I get error
Error Sending data (12175) A security error occurred
I looked at Microsoft error number HERE
ERROR_WINHTTP_SECURE_FAILURE
12175
One or more errors were found in the Secure Sockets Layer (SSL) certificate sent by the server. To determine what type of error was
encountered, check for a WINHTTP_CALLBACK_STATUS_SECURE_FAILURE
notification in a status callback function. For more information, see
WINHTTP_STATUS_CALLBACK.
But I really dont know how to call these callback fundtions or what is causing this error ?
I solved this by unchecked using SSL2 and SSL3 from NetHTTPClient1 and I used only TLS
I had experienced the same error on Windows 7 Pro, reproducible easily by using the Delphi 10.3. Sample "HttpAsyncDownload".
I tested the compiled application on Windows 10 where it runs flawlessly.
Finally, I found following page which solved the issue for me:
https://support.microsoft.com/en-us/help/3140245/update-to-enable-tls-1-1-and-tls-1-2-as-default-secure-protocols-in-wi
Briefly, support for Transport Layer Security (TLS) 1.1 and TLS 1.2 is acitvated for Windows 7. I used the "easy fix", which enables this systemwide as well as for Internet explorer.
Finally, the above sample application "HttpAsyncDownload" runs on Windows 7 Pro flawlessly.
When switching from UIWebView to WKWebView in a Cordova iOS app there are common known problems with same origin policy when loading a web app from the local file system.
The typical fix is to use a local web server (listening on localhost) which serves your HTML,CSS,JS.
This is why I tried to switch to this cordova plugin:
https://github.com/apache/cordova-plugins/tree/wkwebview-engine-localhost
Unfortunately the result is a blank screen. In the web debug console I called
console.log(location.href)
which returns about:blank. Then I tryed navigating to the local web server with this JS call from the console:
location.href = 'http://localhost:8080';
But the web view stays at about:blank. I also tried with different ports and of course I checked my config.xml (e.g. <allow-navigation href="*" />)
I assumed that there is a problem with with the plugin so I switched to Ionic Webview. Interestingly it has the exact same behavior.
In general I am able to navigate to other sites, but not to localhost:[port], so I guess that those plugins are not able to start the web server at all. However, I couldn't find anyone else with this problem.
What could be the reason for this problem? Is there a way to debug this? Unfortunately my web console doesn't report any problems.
The problem here was not to start the web server but connecting to it. The communication has been prevented by VPN (MobileIron) which tries to tunnel those connections. Unfortunately, at the moment there is no solution for WkWebView at all.
We already have Facebook working on our main desktop app without an issue. When I added the same setup code to our mobile site I received an error from the JavaScript SDK:
Received message of type object from https://s-static.ak.facebook.com, expected a string
Then, I changed the setup code to an exact replica from here: https://developers.facebook.com/docs/guides/mobile/web/ and received the exact same message.
This error only shows when the user-agent is iOS or Android in Chrome Developer Tools or in the iOS Simulator. When it's running from the desktop, we aren't seeing this error.
Any idea what's going on here?
Thanks :)
With all due respect, I believe that bokonic's answer is missing the point. The immediate reason of the message you're receiving is most likely javascript postMessage method. It is used to communicate your website with an object returned by window.open or an iframe's embedded website.
window.parent.postMessage(message, targetOrigin);
You might want to have a look at this article to see how it works.
According to MDN reference first argument of the postMessage method can be of any type. Still, Prior to Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3), the message parameter must be a string.
I tested the method on Chrome 28.0.1500.72 (latest version when writing this answer) and it works fine when passing an object but still throws the warning message to the console. I believe that facebook feels uncomfortable with passing some rich data as a string so they pass it as an object and simply doesn't care about the warning. Or, since there is a workaround (e.g. JSON.stringify), they have a bug they don't know about.
I had the same error. This isn't necessarily the reason you're getting it, but I ended up looking at the packets being received by my iphone simulator, and here's the error from s-statick.ak:
[truncated] <span>Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one o
For me, the error is that on my device(s), I'm accessing the site through an ip address (192.168.xx etc) and on local development I have hosts routing localhost to a url that is in my facebook app config... so the IP isn't configured for the app.
Facebook won't let me use an IP address, so it seems like the only option is a test deploy or a DNS server. Hope this helps you out.
I'm having a problem with getting the tutorial to work on the device
it works fine in the simulator, but when I try to run it on the device it doesn't work.
I put some logs and it seems to come from the login function
===JASONROGERS292C 2480 supAdmin s3pAdmin
[0.0] TAC:TAI.handleRegRsp : ALREADY_REGISTERED
[0.0] TAC:TAI.handleRegRsp : (ALREADY_REGISTERED), registered entry found:{{APN=,id=2,state=CLOSED,waf=WAF[0.0] _3GPP,keepAlive=300,IP=0.0.0.0,dnsSrv=0.0.0.0}}
[0.0] [TMM.TunnelAllocator]:runNotReadyListeners: registered listeners found
[0.0] TAC:TAI.handleListenerDeRegRsp: not existent tunnel in TAC, tid=2
[0.0] SIM cache not loaded
has anybody got an idea what I forgot to do when running the code on a device?
Cheers
Jason
edit:
a couple of links towards what I'm doing (I can post all the code people want but its the standard generated code form SUP, which mean a lot of code lol)
The tutorial
http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc01214.0200/doc/html/title.html
the zip to the already done tutorial :
http://www.sdn.sap.com/irj/bpx/index?rid=/webcontent/uuid/40ea4956-b95c-2e10-11b3-e68c73b2280e
Solution:
I was missing a couple of things:
1) Specify that the app should use Wifi
SUP101DB.getSynchronizationProfile().setString("transport", "WIFI");
2) Check that the DNS: in my case the server was local to my windows (through parallels) so I had to specify the ip and not the namespace
getSynchronizationProfile().setServerName("10.50.30.108");//"JASONSERVER");
I downloaded the SUP 101 - BlackBerry Project and checked the sources.
It does not contain networking code in the form a usual BB app would do.
However I see the SUP101.SUP101DB class has the following method:
private static String getSyncTransportSuffix() {
com.sybase.persistence.ConnectionProfile syncProfile =
getSynchronizationProfile();
return com.sybase.afx.util.NetworkUtil.getTransportUrlSuffix(syncProfile);
}
So the code uses com.sybase.afx.util.NetworkUtil to get url suffix. By appending such suffix to a url we say to the underlaying BB API what network transport to use. Unfortunatelly sources do not contain com.sybase.afx.util.NetworkUtil to look how exactly it works.
I should say that even with native Java BB development detecting a proper network transport may turn to be a very tricky part. OS 5+ provides a new networking API that is much better, but for the older OS it is hard. This SUP project is built with BlackBerry JRE 4.6.1, so it can not use new OS 5+ networking API. Who knows maybe SUP simply fails to detect proper network transport?
Any way, just a few ideas to try:
check for APN settings on the device, sometimes they have to be populated in order to use Direct TCP transport (it depends on wireless provider requirements). APN name/pass are wireless provider specific. Usually googling allows to find proper APN settings for a provider.
if your device has WiFi try enabling it. SUP should be smart enough to prefer WiFi if available. In this case I assume networking should have no issues.