PHP と Delphi Soap Server を統合できるソリューションを探しています。PHP SOAP クライアント経由で Delphi SOAP サーバーにファイルを送信したいと考えています。Delphi サーバー コードは、TSoapAttachment を使用して呼び出されます。サンプル コードは次のとおりです。
Ttextminesvc = class(TInvokableClass, Itextminesvc)
public
.....
protected
function UploadFile(afilename: string; afile: TSoapAttachment): Boolean;
stdcall;
.......
function Ttextminesvc.UploadFile(afilename: string; afile: TSoapAttachment): Boolean;
var ffilename: string;
const pathdir = 'C:\tmp';
begin
result := false;
ffilename := pathdir + afilename;
try
if not directoryexists(pathdir) then
ForceDirectories(pathdir);
except
raise Exception.Create('Unable to create repository directory on the server.');
end;
try
if not fileexists(ffilename) then
begin
afile.SaveToFile(ffilename);
result := true;
end;
except
result := false;
end;
end;
ありがとう