@Interloper - To be able to perform this integration, you need two basic requirements:
1 - Your page will be requested, must be habilidada to receive information via HTTP access control (CORS). This will greatly depend on the type of your application! For example, if you are using C # in this project, you'll have to add the following code in your web.config in system.webServer
:
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
</customHeaders>
</httpProtocol>
With this, your project / page will be enabled so that you can make access / exchange of information from any other domain ...
2 - So you can call this URL from any domain, and in our case, a code CasperJS, you can perform a HTTP call using AJAX (jQuery / JS), with the following example:
function get_response(output) {
$.ajax({
type: "POST",
url: "URL",
dataType: "text",
async: false,
data: { param1:value1 },
success: function (response) {
var $doc = $.parseXML(response);
output($($doc).find('TagsXML').find('TAG_RESPONSE1')[0].textContent + '|' + $($doc).find('TagsXML').find('TAG_RESPONSE2')[0].textContent);
},
error: function (response) {
output('');
}
});
}
get_response(function (output) {
test.pass('output: ' + output);
var VALUE1 = output.split('|')[0];
var VALUE2 = output.split('|')[1].replace(/\n/g, "");
});
With this code, you can you perform the "remote access" and the feedback information (if necessary)