如何在wcf和android中创建web服务 [英] how to create web service in wcf and android

查看:88
本文介绍了如何在wcf和android中创建web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,





这里我想开发wcf web服务并通过android将值插入mysql。



提前感谢你,

hello friends,


here i want to develop the wcf web services and inserting values into mysql through android.

thanking you in advance,

推荐答案

你需要了解Web服务的概念,WCF只是一个可用于创建Web服务的技术。



Web服务只是一个应用程序,它充当服务器,可以被连接的设备使用,传递一些数据,执行任何功能。服务器。 WCF是此过程中使用的技术。使用WCF,您可以在任何应用程序(甚至是控制台应用程序)中托管Web服务,并通过任何应用程序甚至网站访问服务,并在服务器上执行一组命令(在我们的示例中;请参阅最后一段,控制台应用程序)。 Android应用程序只是一个客户端,它将使用该服务传递一些数据,执行一个函数等。



但是会有一个你需要了解的几件事,





  • 您的网络服务将托管在计算机上,并带有Uri指定客户端与之通信。
  • 将数据保存在MySQL数据库中的代码将是Web服务功能的一部分,而不是Android应用程序。
  • 创建一个模块,它将连接到MySQL并将数据保存到它。
  • 您将从Android应用程序向您的Web服务发送数据以保存数据。
  • 然后向Android应用程序发送回复。
You need to understand the concepts of a Web Service, WCF is just a technology that can be used to create a web service.

A Web Service is a just an application that acts as a server that can be used by the devices connected, to pass on some data, to execute any function on the server. WCF is the technology used in this process. Using WCF you can host the web service in any application, even a Console application and access the service through any application even websites and execute a set of commands on the server (in our case; see the last paragraph, a Console application). Android application would just be a client, that would be using the service to pass on a few data, to execute a function or so on.

But there would be a few things you need to understand,


  • Your web service would be hosted on a computer, with a Uri specified for the clients to communicate with it at.
  • The code to save the data in the MySQL database would be a part of the Web Service function, not the Android application.
  • Create a module, that would connect to MySQL and would save the data to it.
  • You will send the data from the Android application to your web service to save the data.
  • Send a response to the Android application then.


这篇关于如何在wcf和android中创建web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆