Please check working example here https://github.com/openmeetings/openmeetings-moodle-plugin/blob/master/api/OmGateway.php#L290
On Thu, 13 Feb 2020 at 22:13, moodle dman <moodled...@gmail.com> wrote: > Hi Guys, > I am trying to use the SOAP ws API to upload a file in open meetings, but > no matter what I do I always get a : > > Unmarshalling Error: Unable to create an instance of java.io.InputStream > error. > > I am using php as web-service client. I tried sending a stream to the > web-service, i tried to hardcode the file into web-service parameters, i > tried using get_contents without stream nothing seems to be working. > > This is a sample of code: > ======== > try { > $response = $userserviceclient->login($loginobject); > if ($response->return->type == "SUCCESS") { > $handle = fopen('big_file.txt', 'r'); > //handle = fopen('zimbru.jpg', 'r'); > print_object(fgets($handle)); > $fileuploadobject = new add(); > $fileuploadobject->sid = $response->return->message; > //$fileuploadobject->stream = stream_get_contents($handle); > $fileuploadobject->stream = $handle; > $fileuploadresponse = $fileserviceclient->add($fileuploadobject); > > var_dump($fileuploadresponse); > } > } catch (SoapFault $e) { > var_dump($e); > } > ========================= > > Just as a mention I used a lot of other web-services from the API and all are > working as expected. > > Any clue about this one? > > Thanks! > > -- WBR Maxim aka solomax