Dear Sir
I am trying to call web service from jquery..trying following way but i am not able to pass to complex type parameter to WCF service
My wcf function is as follows
<OperationContract()>
<Web.WebGet(UriTemplate:="/GetData?strErrMsg={strErrMsg}&chrErrFlg={chrErrFlg}", ResponseFormat:=WebMessageFormat.Json, BodyStyle:=WebMessageBodyStyle.Wrapped)> _
Function GetData(ByRef strErrMsg As System.Collections.Generic.List(Of String), ByRef chrErrFlg As String) As String
strErrMsg is System.Collections.Generic.List(Of String)
I am trying to call as follows
var Type;
var Url;
var Data;
var ContentType;
var DataType;
var ProcessData;
var parameters;
function CallWcfService() {
jQuery.ajax
(
{
type: Type,
url: Url,
data: Data, //'{"strErrMsg":"1"},{"chrErrFlg":"A"},{"pcocd":"1"},{"pdiv":"1"},{"ploc":"1"}', // '{'strErrMsg':'1'},{'chrErrFlg':'A'},{'pcocd':'1'},{'pdiv':'1'},{'ploc':'1'}',
contentType: ContentType, //"application/json, charset=utf-8", // content type sent to server
dataType: DataType, //Expected data format from server
cache: "false",
crossDomain: true, //Same result if i remove this line
processdata: ProcessData, //True or False
success: function (msg)
{
ServiceSucceeded(msg);
},
error: ServiceFailed// When Service call fails
}
);
}
function callService()
{
//alert("1");
DataType = "jsonp";
Type = "GET";
var par = 4;
parameters = null;
Url = "http://192.168.2.42/CWSERVERWCF/bedtypemasterService.svc/GetData?strErr Msg=Y&chrErrFlg=c";
ContentType = "application/json; charset=utf-8";
ProcessData = true;
//alert("sssssasasadsds");
CallWcfService();
}
And I am able to call other methods in same way having string and integer parameter.
I have gone through this but didnt get anything
http://stackoverflow.com/questions/17782981/how-to-invoke-wcf-service-having-list-parameter