I have to get a Json object from a web service and I haven´t find any documentation about it. I have to
post an sql sentence to get it. Anyone knows if all this is posible?
ok thanks for your answers.
At the first the web service has a GetJsonString “metod”.
Im trying this code:
$(document).ready(function () {
$.ajax({
type: 'Get',
url: 'http:********************************.asmx?op=GetJSONString',
success: function(returnedJson) {
alert(returnedJson)
}
});
});
and I get this error:
XMLHttpRequest cannot load http:/***********asmx?op=GetJSONString. Origin null is not allowed by Access-Control-Allow-Origin.
You can send your SQL as a parameter of the POST request like
process it with a RPC (remote process call), pack your results in json
and the success callback will get it back as a parameter. The downside is
it is very dangerous sending raw SQL queries from your web application,
it is an easy target for SQL Injection attacks.
So it would be better if you can send a parameter that will define which SQL
query will be executed in the database instead of sending the query itself.