开发者

Call a method from a wsdl generated class

Just wanted to ask if I can call a method coming from a WSDL generated开发者_JS百科 class inside javascript. Thanks!


If you mean a class generated by importing the WSDL using Add Service Reference / svcutil, then no, since those tools don't support generating javascript clients.

If you want to access a WCF service via javascript, you should add a non-SOAP (REST) endpoint to the service, since it can take / return JSON data (which is easy to create / consume in JS). You can also take a look at http://wcf.codeplex.com, which has an extension for accepting the native data format used by jQuery's ajax calls (application/x-www-form-urlencoded), along with some samples.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜