开发者

Call a method from a wsdl generated class

开发者 https://www.devze.com 2023-03-07 10:57 出处:网络
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 / sv

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

精彩评论

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