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.
精彩评论