We need to communicate with a Web Service via scripting (javascript, vbscript, jquery). We are getting an error trying to communicate with the Web Service. From the articles I have read it seems this line needs to be added into the Web Service:
[System.Web.Script.Services.ScriptService]
. Thing is we are not able to add this into service as it's a published site that comes with the software.
Will I be able to still call this service without that attribute? Is there anything else I can do to make the call using scripting language?
What I have tried:
<script type="text/javascript">
$(document).ready(function()
{
$.ajax
(
{
type: "POST",
url: "myurl/method",
data: "{Operator:'elizma',OperatorPassword:'test',CompanyId:'T',CompanyPassword:'test',LanguageCode:'AUTO',LogLevel:'ldNoDebug',EncoreInstance:'EncoreInstance_0',XmlIn:''}",
contentType: "application/json; charset=utf-8",
datatype: "json",
success: OnSuccessCall,
error: OnErrorCall
}
);
}
);
function OnSuccessCall(response) {
alert(response.d);
}
function OnErrorCall(response) {
alert(response.status + " " + response.statusText);
}
</script>