I have ASP.NET code
public class OrderInformationResponse
{
public GetOrderLookupResponseType orderLookupResponse { get; set; }
}
[System.Web.Services.WebMethod]
public static OrderInformationResponse GetOrderInformation(string jobId, string userId, string jobDetails) {
OrderInformationResponse response = new OrderInformationResponse();
JobDetails jobDetailsEnum = (JobDetails)Enum.Parse(typeof(JobDetails), jobDetails);
response.orderLookupResponse = GetOrderLookup(jobId, userId);
return response;
}
I try calling this from jQuery with:
$.ajax({
type: "POST",
url: "somePage.aspx/GetOrderInformation",
data: "{'jobId':" + jobId + ", " +
" 'userId':" + userId + ", " +
" 'jobDetails':" + jobDetails +
"}",
contentType: "application/json; charset=utf-8",
datatype: "json",
async: true,
cache: false,
success: function (msg) {
p_Func(msg); // This is a pointer to function.
}
});
Declaration of GetOrderLookupResponseType:
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.17929")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.somewhere.uk/MessageContracts/OrderManagement/OrderInfo/2010/02")]
public partial class GetOrderLookupResponseType { ... }
I can't get anything on client side. Before this I was trying to return GetOrderLookupResponseType from another method marked [WebMethod] and it worked, but when I tried to put it in a newly created OrderInformationResponse it stopped working. (I plan to fill OrderInformationResponse with additional stuff, that's why I'm not using the method that worked).
jobDetailsis sent as a string, but I didn't put any quotes around it. Please answer the question so I can accept your response.