6

How do I create a PHP Web service to receive data from third parties?

 3 years ago
source link: https://www.codesd.com/item/how-do-i-create-a-php-web-service-to-receive-data-from-third-parties.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How do I create a PHP Web service to receive data from third parties?

advertisements

I'm creating a webservice in which remote sites can send data to a PHP-based webservice. However, I'm struggling to come up with the best way of handling the incoming data.

The data will be in the form of shopping basket contents, so might include product name, price, ID, date, customer etc. There will be one line of data for each product in the basket, so there could be 20-30 lines for some customers.

Would sending the data to the webservice via GET be sensible? Is there a better option you can think of? Any input is greatly appreciated.

Thanks!


Probably not a great idea to send via get. I'd generate the basket as XML or JSON, then post it to the service. You can then write back a response on XML or JSON saying whether or not the call was successful.

A nice introduction to a RESTful API with PHP is here. I find it goes a bit overboard in some places, you can do the same with a little less code but it is nonetheless a good guide.

Related Articles

The best way to create a PHP Web service

Not really a PHP developer, but I have PHP hosting and would like to create a PHP Web Service on it to be consumed by a .NET Client, I am thinking of using WSDL with NUSoap. OR A more modern solution, which I am not sure would be easier, would be to

How can I call my PHP web service properly using ksoap2-android?

So far I have created a PHP client, and a VB.NET client which both successfully call my PHP web-service. To get the latter to work I needed to use the SoapUI tool from SourceForge. It told me that my wsdl was not WS-I compliant. I did not need the Pr

Error when calling a Web service and receiving data

I Try To Receive Data From A Web-Service Using This Code But An Fatal-Error Occurred package com.example.lo2i05; import java.io.IOException; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; im

How to secure a RESTful php web service with SSL / TLS and / or message-level security

I have a RESTful web service written in php that uses JSON for communication. Some of the data transmitted is really sensitive (passwords) and I am looking for a way to achieve a reasonable security level for the service. The client is a silverlight

Create a PHP Web service to respond to the Android app in JSON format

Previously i have used restful wcf webservices to get the data from server.But now i have to access PHP webservices.Using WCF restful webservices I used to get data as : { 1,books, //0th index 2,toys, //1st index . . . } but wen i am getting data fro

How do I access a PHP Web service from ASP.Net?

I am trying use a web service in a C# ASP.Net Web Application. The service is built in PHP and is located on some remote server not under my control so I cant modify it to add meta data or something else into it. When I use the "Add Web Reference&quo

How can I create a Java web service (jax-ws) with array or List as parameter

I've got a problem with web service wich has array or List as parameter. Here is example: @WebMethod public String printList(@WebParam(name = "list") List<String> list) { String result = ""; if(list == null) { result = "list

How do I know if a web service is returning data in XML or JSON format?

If its a third party web service, how will I know if it returns data in XML or JSON format? I guess if its created in .NET, then I just look at the WSDL provided for the web service? Is that correct?You can always look at the HTTP headers in the resp

How to use an asp.net web service to refresh only a small part of the asp.net 4.0 web page without editing any other part

I know how to write a web-service but until now I used them with always ready scripts. What I want to do this time is, have a web-service will return a string and I want to display this string in a part of webpage. That part may be inside an update p

Expose the SQL Server database as a Web service to obtain data from

Is there any .NET tool to expose the data of my tables in Microsoft SQL Server as web services? Do I have to write the code? Are there any samples? What do your recommend as to how to expose the data?While to use WCF Data Services can be an option, j

How do I create a DataTable and fill it with data from the database using DataView?

I am a new ASP.NET developer and I want to create a table programmatically using HtmlTable or DataTable and then filling this table with the data from the database using DataView. I could be able to create a table using HtmlTable but when I did a sea

how to call a function in the directive after receiving data from two different services?

I have lot of service call in my controller, after getting the data from those service, i want to trigger a function in directive. // This is my controller function myctrl() { Serv.query({"type":"PageDetails"}, request.pageDetails, fun

How can I create a small Mac application that receives data via the WiFi network from an iOS application?

What I need is to have a simple screen in this Mac app that just prints a string as the iPhone is transmitting strings through the WiFi network. This string is simply a string value from a slider being adjusted up and down by the user on the iPhone.

How can I create a PHP web form that validates an email address?

I was looking around and cannot seem to find a way to create a simple form with no submit button (enter only) that checks to make sure that the information typed in is really a email address. Any help would be appreciated. *Disclaimer I know almost n

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK