简体   繁体   中英

Calling C# WebService to Javascript for Android

I have a wsdl service and as I generate it with svcutil.exe, it gave me a .cs file. Now my question is how can I call the service with javascript for android. Where do I go from here? Any suggestions or any reference/step-by-step tutorial or a sample demo would be a great help for me. I am developing an application for android with phonegap 1.4.1, Many thanks.

The .cs file you have is just a DTO. You would need to code you Operations and Data contracts in the WCF service to make anything happen.

With javascript in mind, I would just use JQuery and the .Ajax() method for making the calls from the client side. There are tons of articles on how to accomplish that.

http://www.codeproject.com/Articles/128478/Consuming-WCF-REST-Services-Using-jQuery-AJAX-Call

http://forums.asp.net/t/1513059.aspx/1

JQuery/WCF without ASP.NET AJAX:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM