Trying to get SOAP_Attachment to Delphi
| From: | raltgaither@yahoo.com | Date: | Fri, 13 Feb 2004 22:02:31 +0000 |
| Subject: | Trying to get SOAP_Attachment to Delphi | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-1361@lists.php.net to get a copy of this message | ||
Hi, All.
I've read the messages here about sending Attachments to Delphi, and I've made Dave's "adjustments" to the appropriate files, but I still can't get this thing to work.
In Delphi I'm looking for the return value to be "TSoapAttachment". It seems to want to be a "TByteDynArray". Here's my server code to generate the wsdl:
$this->__dispatch_map['getXML'] = array(
'in'=>array(),
'out'=>array('response' => 'base64Binary')
);
If I change 'base64Binary' to 'TSoapAttachment' (cheating, I know), Delphi presents the correct return value but I get an error when I click the button to load the file.
Here's my actual method:
function getXML(){
$cm_path = "/home/httpd/httpdocs/services/";
$cm_file = "test.xml";
if (file_exists($cm_path.$cm_file)){
return new SOAP_Attachment('Response','application/binary',$cm_path.$cm_file);
}
else {
return new SOAP_Value('return', 'application/binary', false);
}
}
Which part am I screwing up? If it helps, here's my client side in Delphi:
procedure TForm1.Button1Click(Sender: TObject);
var
Intrf : CV3_Web_ServicePort;
xmlDoc : TXMLDocument;
myStream : TStream;
myAttachment : TSOAPAttachment;
begin
Intrf := GetCV3_Web_ServicePort(False, '');
try
myAttachment := Intrf.getXML;except
on E : Exception do
ShowMessage(E.Message);
end;
myStream := myAttachment.SourceStream;
xmlDoc := TXMLDocument.Create(nil);
xmlDoc.LoadFromStream(myStream);
ListBox1.Items.AddStrings(xmlDoc.XML);
end;
Any help is much, much appreciated!
Thanks,
Blake <raltgaither@yahoo.com>