استغلال Web Service من خلال SOAP في دلفي
#6
نغير اسم المشروع الى Delphi2009WS_1.dproj
،حفضه في المجلد
Source
كود :
http://www.arabteam2000-forum.com/uploads/monthly_06_2009/post-1034-1245607702.jpg
service1Intf.pas
يعتبر هذا الملف الوحدة التي نجد فيها interface الخاصة بالمشروع و التي يجب ان نعرف او نصرح فيها عن جميع الوظائف المستعملة في المشروع
كود :
{ Interface invocable Iservice1 } unit service1Intf; interface uses InvokeRegistry, Types, XSBuiltIns; type { Les interfaces invocables doivent dériver de IInvokable } Iservice1 = interface(IInvokable) ['{E4F6BF94-1745-4498-BBA2-9F6003FBED4E}'] function ShwoHelloWorld():string; stdcall; { Les méthodes de l'interface invocable ne doivent pas utiliser la } { convention d'appel par défaut ; stdcall est conseillé } end; implementation initialization { Les interfaces invocables doivent être recensées } InvRegistry.RegisterInterface(TypeInfo(Iservice1)); end.

service1Impl.pas
هي الوحدة التي نكتب فيها اكواد الوظائف .
,في نقوم بimplementation للواجهة service1Intf

كود :
{ Fichier d'implémentation invocable pour Tservice1 implémentant Iservice1 } unit service1Impl; interface uses InvokeRegistry, Types, XSBuiltIns, service1Intf; type { Tservice1 } Tservice1 = class(TInvokableClass, Iservice1) public function ShwoHelloWorld():string; stdcall; end; implementation function Tservice1.ShwoHelloWorld():string; begin Result:= 'Hello World'; end; initialization { les classes invocables doivent être recensées } InvRegistry.RegisterInvokableClass(Tservice1); end.

تجربة المثال الاول
ننقل الملف الناتج
الى Delphi2009WS_1.exe
C:\Inetpub\wwwroot\Delphi2009WS
نكتب في IE
http://localhost/Del...phi2009WS_1.exe
و الان اصبحت الخدمت جاهزة
كود :
http://www.arabteam2000-forum.com/uploads/monthly_06_2009/post-1034-1245609241.jpg
لم يبقي الا كيف الاستفادة من هذه الخدمة
الرد


الردود في هذا الموضوع
استغلال Web Service من خلال SOAP في دلفي - بواسطة زكيري عبدالعالي - 27-06-2011, 08:18 AM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم