javascript - Calling WCF service POST method from jQuery Ajax -


i have following wcf method

[operationcontract] [webinvoke(method = "post")] public string helloworld(string stest) {     return stest.tostring(); } 

and have jquery ajax client code below

$.ajax({         type: "post",         contenttype: "application/json; charset=utf-8",         url: '../../service.svc/helloworld',        data: { 'stest': 'testdata' },         datatype: 'json',         success: function (resp) {          },         error: function (error)         {             alert(error);         }     }); 

when ajax invoke hellowworld method,

error networkerror: 500 internal server error.

how call wcf post method jquery ajax.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -