1
我正在尋找可以在PHP和Delphi Soap服務器之間進行集成的解決方案。我想通過PHP Soap Client將文件發送到Delphi SOAP服務器。 Delphi的服務器代碼將使用TSoapAttachment和示例代碼被調用低於: -帶有文件附件和PHP作爲客戶端的Delphi SOAP服務器
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;
由於
所以你的實際問題是「我怎樣才能用PHP SOAP客戶端發送文件附件」? – DaveRandom 2012-07-27 09:11:46
相關:http://stackoverflow.com/questions/1529263/file-attachements-with-php5-soap。在這件事上圍繞谷歌的一個非常簡短的暗示表明,如果沒有滾動你自己的PHP的PHP客戶端,這是不可能的,但我很樂意在這件事上被證明是錯誤的。 – DaveRandom 2012-07-27 09:15:29
是的,使用PHP發送一個文件到Delphi SOAP服務器。我在使用函數UploadFile(afilename:string; afile:TSoapAttachment)時遇到了問題。如何處理PHP中的TSoapAttachment? – akunyer 2012-07-27 09:25:59