Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# & PHP: Simple example of PHP Web Service used by C#

Could anyone give me a small and simple example of how to do this? Or some good pointers on how to get started.

I would like to create a C# client that can send a file or some text or xml or whatever, to a web service or something similar written in PHP, where the PHP Web Service stores it in a file or a database or something like that. Just not sure how to get started.

I guess the first step would be to create the php web service. And then it perhaps would be quite easy to use it in C#, since I could probably pretty much use the "Add Web Reference" button in vs and then go from there?

like image 683
Svish Avatar asked Feb 07 '09 09:02

Svish


People also ask

What C is used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

What is the full name of C?

In the real sense it has no meaning or full form. It was developed by Dennis Ritchie and Ken Thompson at AT&T bell Lab. First, they used to call it as B language then later they made some improvement into it and renamed it as C and its superscript as C++ which was invented by Dr.

Why is C named so?

Quote from wikipedia: "A successor to the programming language B, C was originally developed at Bell Labs by Dennis Ritchie between 1972 and 1973 to construct utilities running on Unix." The creators want that everyone "see" his language. So he named it "C".


2 Answers

I'm not versed in the C# aspect of your question, which you intend to be the consumer. But if you don't mind using a library to expedite the process of getting the webservice up and running, you can set one up very quickly using Zend Framework. Check out the documentation for setting up a Zend_Rest_Server.

like image 28
chuckg Avatar answered Sep 30 '22 00:09

chuckg


You can take a look at this tutorial showing how to develop a web service using php. The .NET client will be pretty straightforward as you mentioned.

like image 162
Darin Dimitrov Avatar answered Sep 30 '22 02:09

Darin Dimitrov