下記のようにContentTypeを指定することで解消できました。
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[ScriptService]
public class WebService : System.Web.Services.WebService
{
[WebMethod]
public Employee[] GetEmployessXML()
{
Employee[] emps = new Employee[] {
new Employee()
{
Id=101,
Name="Nitin",
Salary=10000
},
new Employee()
{
Id=102,
Name="Dinesh",
Salary=100000
}
};
return emps;
}
[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
public void GetEmployessJSON()
{
Employee[] emps = new Employee[] {
new Employee()
{
Id=101,
Name="Nitin",
Salary=10000
},
new Employee()
{
Id=102,
Name="Dinesh",
Salary=100000
}
};
JavaScriptSerializer js = new JavaScriptSerializer();
Context.Response.Clear();
Context.Response.ContentType = "application/json";
Context.Response.Write(js.Serialize(emps));
}
}