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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -