Jquery Ajax calling WCF (asp.net)
Hello , I succeedd in calling the wcf however
as you can see in the URL I'm passing an argument called name
if I pass in the name english all is ok , but when I'm passing hebrew in the name I'm
getting gibrish no matter what.
what could be wrong ?
one more question is it make sense calling WCF with type: "POST" (as calling a page method) ?
TIA
// Using jQuery to directly call WCF
$.ajax({
type:
"GET"
,
contentType:
"application/json; charset=utf-8"
,
url:
"Service.svc/DoWork?name="
+name,
data:
"{'name': '"
+ name +
"'}"
,
dataType:
"json"
,
success:
function
(msg) {
AjaxSucceess(msg);
},
error: AjaxFailed
});
// WCF method
[WebGet(ResponseFormat=WebMessageFormat.Json) ]
public string DoWork(string name)
{
// Add your operation implementation here
return name;
}