I'm writing a php script which is interfacing with a SOAP client (which is internally using java).
One of the calls requires that I pass Base64 encoded content.
I'm passing it like this:
(Edit 1)
$content=file_get_contents('fileX');
fileX is a binary file which has been uploaded via POST and saved s开发者_开发百科uccessfully in /tmp.
It is ~600kb in binary form.
$args[]=array('name'=>'content', 'value'=>base64_encode($content), 'type'=>'Base64Binary');
But, I'm getting an error:
java.lang.String cannot be cast to java.io.InputStream
(Edit2)
The documentation of the third party application says exactly:
Parameter Description Type
filename The name of the presentation file String
including the file extension.
content The content of the presentation file Base64Binary
encoded in Base64 scheme.
The second parameter in the array is of type String, due to the output type of base64_decode
. That Java error implies that it is expecting an object of type InputStream.
You may need to use the Zend PHP Java Bridge as seen here:
https://fosswiki.liip.ch/display/~chregu/Convert+PHP+String+to+a+Java+InputStream
in order to convert that String to a Java InputStream.
Download Zend Server here:
http://www.zend.com/en/products/server/downloads
or an alternative PHP Java Bridge here:
http://php-java-bridge.sourceforge.net/pjb/installation.php
精彩评论