I’d suggest to try Mega Demo JavaScript client first. It works in IE9 with JSONMessage. BinMessage isn’t supported in IE. Please tell if it works in your environment.
But If I use generated NewLibrary_intf.js using RO Service Builder (CodeGen -> Javascript -> RO SDK for Javascript (.js) ) , nothing works … I get empty result no matter what browser I am using (firefox, IE,etc).
I want to use generated intf file to save my work with a real service…
I attached a very simple test case reproducing my problem, what I am doing wrong?
I used that article because generated version not worked, but now is ok, JSONMessage.WrapResult := true worked …
One detail, in FPC/Linux only works with I put RemObjectsSDK.js in my server html folder, not RemObjectsSDK.js but remobjectssdk.js (filename problem).
Like you said in another post (http://connect.remobjects.com/discussion/901/javascript) RemObjectsSDK.js is embedded into
ROJavaScriptHttpDispatcher component but in FPC is not working (I think due to this filename problems).
Now I am testing RO DataAbstract JS with no success in IE:
msg.getErrorMessage() returns a empty message.
Chorme, Firefox OK. RO SDK in IE OK too.
Using JSON:
var Channel = new RemObjects.SDK.HTTPClientChannel(“http://localhost:8099/JSON”);
var Message = new RemObjects.SDK.JSONMessage();
var Service2 = new RemObjects.SDK.RemoteService(Channel, Message, “ScarabService”);
var Service3 = new RemObjects.SDK.RemoteService(Channel, Message, “LoginService”);
var daService = new DataAbstractService(Service2);
var Adapter = new RemObjects.DataAbstract.RemoteDataAdapter(Service2,Service3, RemObjects.DataAbstract.Bin2DataStreamer);
var aTable = new RemObjects.DataAbstract.DataTable(“SQL”);
var requestInfo = RemObjects.DataAbstract.Util.createRequestInfo()
Adapter.getData(aTable,requestInfo, isOK , function(msg) {
alert('ERRO = '+msg.getErrorMessage()) });
I'd love to, but its XMLHTTPRequest just doesn't post binary data (treats it as a string and truncates at first zero byte)
I think that a simple solution to this problem would be to add an ‘EscapeZero’ option to the BinMessage class, or to create a new EscapedBinMessage class.
If enabled, on the server side every #0 char is replaced with i.e. #FF#F0, #FF is replaced with a double #FF#FF; the reverse is done on the client.
It’s a widespread solution for low-level serial communications.
Couldn’t it be implemented as an Envelope then ?
Obvioulsy if you want IE9 compatibility you would have to add that Envelope to all of your clients, at least the ones connecting via HTTP (and implement the Envelope also in Javascript).
i.e. with two channels on the server side: one SuperTCP+BinMessage for “standard” clients, one HTTP+BinMessage+Envelope for Javascript ones, would it work at least in theory ?