开发者

Is this possible to document(word) transfer by using SOAP or XML_RPC?

开发者 https://www.devze.com 2023-02-13 02:57 出处:网络
HI All, Now i want to send a file(c# Client) to server using SOAP.but i dont know whether it is possible to 开发者_开发知识库send file by using SOAP.Does anybody having knowledge about file transfer

HI All,

Now i want to send a file(c# Client) to server using SOAP.but i dont know whether it is possible to 开发者_开发知识库send file by using SOAP.Does anybody having knowledge about file transfer using SOAP or any other for example XML-RPC, please send me your thoughts...

Thanks & Regards, P.SARAVANAN.


The easiest way is to read the file (e.g. file_get_contents()), encode it in some way (e.g. base64_encode()) and pass it to the SOAP or XML-RPC call as a parameter. Example:

$soap = new SoapClient('url/to/your.wsdl');
$soap->upload(base64_encode(file_get_contents('file/to/upload')));

This, of course, assumes a SOAP server that has a method called upload that accepts base64_encoded files.

0

精彩评论

暂无评论...
验证码 换一张
取 消