我有如下服务
<OperationContract()>
<Web.WebGet(UriTemplate:="/GetBedTypeList1?strErrMsg={strErrMsg}&chrErrFlg={chrErrFlg}&pcocd={pcocd}&pdiv={pdiv}&ploc={ploc}", ResponseFormat:=WebMessageFormat.Json, BodyStyle:=WebMessageBodyStyle.Wrapped)> _
Function GetBedTypeList1(ByRef strErrMsg As String, ByRef chrErrFlg As Char, _
ByVal pcocd As String,
ByVal pdiv As Integer, _
ByVal ploc As Integer) As System.Collections.Generic.List(Of CWReadClasses.clsBedTypeMaster)
我试图将其称为如下
function callService()
{
DataType = "json";
Type = "GET";
var par = 4;
//parameters = null;
Url = "192.168.22.2/BedTypeMasterService.svc/GetBedTypeList1?strErrMsg=Y&chrErrFlg=c&pcocd=1&pdiv=1&ploc=1"
ContentType = "application/json; charset=utf-8";
ProcessData = true;
CallWcfService();
}
function CallWcfService()
{
jQuery.ajax
(
{
type: Type,
url: Url,
data: parameters, //'{"strErrMsg":"1"},{"chrErrFlg":"A"},{"pcocd":"1"},{"pdiv":"1"},{"ploc":"1"}', // '{'strErrMsg':'1'},{'chrErrFlg':'A'},{'pcocd':'1'},{'pdiv':'1'},{'ploc':'1'}',
contentType: ContentType, // 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
}
);
}
每次我得到程序或函数时都期望这个参数,但是在本地主机上运行,服务部署了相同的代码..这意味着 Web 服务没有使用上述代码接收参数......