Yes. But there could be a bug in the exported CSS/HTML code or somewhere else.
Here how to reproduce.
A)
Let someone make a super simple service. I have already made one here:
ofto3.cloudapp.net:8082/datasnap/rest/TServerMethods1/echoAttribute/Attr1
(A demo function in the Delphi Datasnap product see http://docwiki.embarcadero.com/RADStu... )
The purpose of this service is to return the textstring in the JSON key "Attr1". The JSON object must be sent in the body of the REST call (not in the url).
B)
Use Your favorite HTTP send test tool and enter data
Method: Post
{"Attr1":"Hello World"}
Verify that you get this in return
{"result":["Hello World"]}
And also check for * in access-control-allow-origin
C)
Now make one of the Worlds simplest Tiggzi apps. Add one service.
One input and one text. The button invokes the service. Make an Alert Message if the service fails so you can easily see what happens.
With Tiggzi proxy on everything works perfect. Now do not include Tiggzi proxy on the service by removing the checkmark. (When you test without proxy the service fails for Mozilla firefox and safari. IE is more relaxed to cross-origin problems and it in fact works fine here.)
The service:
D)
Make your own Internet Information server 7. Enable Cors on that server. See http://enable-cors.org. Verify that this site acknowledge this to be a cors (cross-origin) server. Can be done at the same page. Put you exported files on your new web server. (CORS setup on the server handling the REST service is already enabled.)
E)
Now suddenly all browser types report an error when run from the new server. Even IE.
Firebug says: "NetworkError: 500 Internal Server Error - http://ofto3.cloudapp.net:8082/datasn...". When using GET instead of POST everything works fine.
Ole.
Part of the generated exported js code :
var RESTService = new Tiggr.RestService({
'url': 'http://ofto3.cloudapp.net:8082/datasn...',
'dataType': 'json',
'type': 'post',
'contentType': 'application/json',
});
...
/*************************
* NONVISUAL COMPONENTS *
**********************/
var datasources = [];
restservice2 = new Tiggr.DataSource(RESTService, {
'onComplete': function(jqXHR, textStatus) {
$t.refreshScreenFormElements("j_0");
},
'onSuccess': function(data) {},
'onError': function(jqXHR, textStatus, errorThrown) {
alert("service failed");
},
'responseMapping': [{
'PATH': ['result[0]'],
'ID': 'mobilelabel19',
'ATTR': '@'
}],
'requestMapping': [{
'PATH': ['Attr1'],
'ID': 'mobiletextinput18',
'ATTR': 'value'
}]
});
datasources.push(restservice2);
/*********************