Service Implementation and PHP

Hi,

I'm staring a new project and want to develop the engine part using XData and Service implementation(calling XData Methods), the client side will be using PHP.

Is there any simple sample code using PHP and XData methods, something like this?
Delphi code...
...
type
[ServiceImplementation]
TMyService = class(TInterfacedObject, IMyService)
private
function Sum(ASumClas : TSumClass): TResultSumClass
end;

implementation
function TMyService.Sum(ASumClass:TSumClass): TResultSumClass;
begin
Result := TResultSumClass.Crete;
Result.SumResult := ASumClass.A + ASumClassB;
end;

PHP code... ?

How to call a method with a class as parameter and get a result class from XData-Delphi using PHP as client?

Thanks in advance,

Omar Zelaya

You should learn how to "call XData methods" using pure HTTP, here: http://www.tmssoftware.biz/business/xdata/doc/web/invoking_operations_using_http.html

Once you learn that you can use it from any language that is available to perform HTTP requests (virtually all of the most popular languages).
As a side note, I wonder how are you using PHP "as a client", since PHP is mostly a server-side language?

Hi,

Thanks for the link, actually I dont have any knololedge about PHP. I know about Delphi and XData as engine and using the same Delphi as client to call XData methods(IntraWeb, Desktop,Mobile...etc). What I have meant for client part was that the developer will be using PHP for web pages for UI and calling XData methods for data access under delphi.

Thanks In Advance,

Omar Zelaya

As I explained in the previous post, you can call any XData method using that approach. Of course you need to know how to perform HTTP requests from the language you are using (PHP in this case).