You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@openmeetings.apache.org by moodle dman <mo...@gmail.com> on 2020/02/13 15:13:21 UTC

SOAP upload file issue

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!

Re: Desktoplayout structure

Posted by "R. Scholz" <re...@abakus-edv-systems.de>.
Hello Maxim,

/Or it is new room type "Lecture room" (with only one possible video?/
Good question. In normal case in a webinar only one person streaming his 
video.
"Lecture room" is a good name for this. (In a "conference-room" are 
different requirement.)

Yes, something like that - it's an idea for discussion.
I'm dying to know what the other mean.

Best regards,

René




Am 18.02.2020 um 15:10 schrieb Maxim Solodovnik:
> Hello Rene,
>
> first of all thanks for your ideas
>
> second it's not me ""a little bit angry" when anyone post a jpg" but 
> program processing mailing-lists can drop attachment without any 
> warning :)
>
> According to this idea: how this room will look like in case there 
> will be more than one video pod?
> Or it is new room type "Lecture room" (with only one possible video?
>
> On Tue, 18 Feb 2020 at 16:48, René Scholz 
> <rene.scholz@abakus-edv-systems.de 
> <ma...@abakus-edv-systems.de>> wrote:
>
>     Hello,
>
>     yesterday I took a webinar which was presented with "Adobe Connect".
>
>     One "eye-catching thing" for me was the structured layout of the
>     screen.
>
>     I made a phote and put it on my webspace - I remembered that Maxim
>     is "a
>     little bit angry" when anyone post a jpg in an email.
>
>     You find it here:
>     https://abakus-edv-systems.de/OM5/ExampleStructureDesktop.jpg
>
>     In my opinion its important, especially for (new) OM-user or
>     admins, to
>     have a tidy impression.
>     I mean its great to place the mod-video-window wherever I want,
>     but the
>     most users don't touch the elements they see on the screen.
>     (One user told me that he not know if any-/everybody could see
>     that when
>     he make something. He was afraid to look ridiculous.)
>
>     What do you mean? Will it make our OM better when it will be
>     possible to
>     define a "structured-default-layout" in the room-configuration?
>
>     With best regards,
>
>     René
>
>
>
>
>
> -- 
> WBR
> Maxim aka solomax


Re: Desktoplayout structure

Posted by Maxim Solodovnik <so...@gmail.com>.
Hello Rene,

first of all thanks for your ideas

second it's not me ""a little bit angry" when anyone post a jpg" but
program processing mailing-lists can drop attachment without any warning :)

According to this idea: how this room will look like in case there will be
more than one video pod?
Or it is new room type "Lecture room" (with only one possible video?

On Tue, 18 Feb 2020 at 16:48, René Scholz <re...@abakus-edv-systems.de>
wrote:

> Hello,
>
> yesterday I took a webinar which was presented with "Adobe Connect".
>
> One "eye-catching thing" for me was the structured layout of the screen.
>
> I made a phote and put it on my webspace - I remembered that Maxim is "a
> little bit angry" when anyone post a jpg in an email.
>
> You find it here:
> https://abakus-edv-systems.de/OM5/ExampleStructureDesktop.jpg
>
> In my opinion its important, especially for (new) OM-user or admins, to
> have a tidy impression.
> I mean its great to place the mod-video-window wherever I want, but the
> most users don't touch the elements they see on the screen.
> (One user told me that he not know if any-/everybody could see that when
> he make something. He was afraid to look ridiculous.)
>
> What do you mean? Will it make our OM better when it will be possible to
> define a "structured-default-layout" in the room-configuration?
>
> With best regards,
>
> René
>
>
>
>

-- 
WBR
Maxim aka solomax

Desktoplayout structure

Posted by René Scholz <re...@abakus-edv-systems.de>.
Hello,

yesterday I took a webinar which was presented with "Adobe Connect".

One "eye-catching thing" for me was the structured layout of the screen.

I made a phote and put it on my webspace - I remembered that Maxim is "a 
little bit angry" when anyone post a jpg in an email.

You find it here:
https://abakus-edv-systems.de/OM5/ExampleStructureDesktop.jpg

In my opinion its important, especially for (new) OM-user or admins, to 
have a tidy impression.
I mean its great to place the mod-video-window wherever I want, but the 
most users don't touch the elements they see on the screen.
(One user told me that he not know if any-/everybody could see that when 
he make something. He was afraid to look ridiculous.)

What do you mean? Will it make our OM better when it will be possible to 
define a "structured-default-layout" in the room-configuration?

With best regards,

René




Re: SOAP upload file issue

Posted by Maxim Solodovnik <so...@gmail.com>.
https://cxf.apache.org/

https://cxf.apache.org/docs/sample-projects.html

On Wed, 19 Feb 2020 at 13:27, Daniel Baker <dj...@gmail.com> wrote:

> Ok what is CXF ?
>
> On Wed, 19 Feb 2020, 02:45 Maxim Solodovnik, <so...@gmail.com> wrote:
>
>> Hello Daniel,
>>
>> I don't have experience in sending files over soap
>> And unfortunately have no time to investigate the topic
>> I can recommend to check CXF examples
>>
>> On Sat, Feb 15, 2020, 21:52 Daniel Baker <in...@collisiondetection.biz>
>> wrote:
>>
>>> Hi Maxim,  I can confirm it  works  through  REST  and your  official
>>> OM  moodle plugin.  Would it be possible for  you to check that  it can be
>>> done through  SOAP ?
>>>
>>> We are struggling to make it  work  but  have  been successful with
>>> several of the other SOAP API  calls.
>>>
>>> Best Regards,
>>>
>>>
>>> Dan
>>> On 2/13/2020 3:23 PM, Maxim Solodovnik wrote:
>>>
>>> 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 <mo...@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
>>>
>>>

-- 
WBR
Maxim aka solomax

Re: SOAP upload file issue

Posted by Daniel Baker <dj...@gmail.com>.
Ok what is CXF ?

On Wed, 19 Feb 2020, 02:45 Maxim Solodovnik, <so...@gmail.com> wrote:

> Hello Daniel,
>
> I don't have experience in sending files over soap
> And unfortunately have no time to investigate the topic
> I can recommend to check CXF examples
>
> On Sat, Feb 15, 2020, 21:52 Daniel Baker <in...@collisiondetection.biz>
> wrote:
>
>> Hi Maxim,  I can confirm it  works  through  REST  and your  official OM
>> moodle plugin.  Would it be possible for  you to check that  it can be done
>> through  SOAP ?
>>
>> We are struggling to make it  work  but  have  been successful with
>> several of the other SOAP API  calls.
>>
>> Best Regards,
>>
>>
>> Dan
>> On 2/13/2020 3:23 PM, Maxim Solodovnik wrote:
>>
>> 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 <mo...@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
>>
>>

Re: SOAP upload file issue

Posted by Maxim Solodovnik <so...@gmail.com>.
Hello Daniel,

I don't have experience in sending files over soap
And unfortunately have no time to investigate the topic
I can recommend to check CXF examples

On Sat, Feb 15, 2020, 21:52 Daniel Baker <in...@collisiondetection.biz>
wrote:

> Hi Maxim,  I can confirm it  works  through  REST  and your  official OM
> moodle plugin.  Would it be possible for  you to check that  it can be done
> through  SOAP ?
>
> We are struggling to make it  work  but  have  been successful with
> several of the other SOAP API  calls.
>
> Best Regards,
>
>
> Dan
> On 2/13/2020 3:23 PM, Maxim Solodovnik wrote:
>
> 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 <mo...@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
>
>

Re: SOAP upload file issue

Posted by Daniel Baker <in...@collisiondetection.biz>.
Hi Maxim,  I can confirm it  works  through  REST  and your official OM  
moodle plugin.  Would it be possible for  you to check that  it can be 
done through  SOAP ?

We are struggling to make it  work  but  have  been successful with 
several of the other SOAP API  calls.

Best Regards,


Dan

On 2/13/2020 3:23 PM, Maxim Solodovnik wrote:
> 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 <moodledman@gmail.com 
> <ma...@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

Re: SOAP upload file issue

Posted by Maxim Solodovnik <so...@gmail.com>.
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 <mo...@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