soap lua client ?

Hi all,

I’m not a developper, but I do a php soap webservice.

The idea is to get external information from my server like owfs temperature, zoneminder alarm, etc …
and create some virtual device.

Do some one can help me to do a soap client from vera2 to a webservice ?

Have you got other idea to catch external information ?

I can’t see any information on soap client on vera.

thank you.

Even if I’ve got no reply, I answer me.

Here is where Am I.

I could do a simple soap server with php on my ubuntu server. On a special client soap, I get from a function the temperature of my OWFS ( One wire), but from now with this method I can get what I want on my ubuntu server. There is a way to have a soap request without a soap client.

It’s CURL !

So someone could help me to transform in lua this syntaxe:
curl -X POST -d @req.txt http://example.org/server

Thank you.

Hi gilles,

You can use this function:

-------------------------------------------------------------------------------------
-- Execute the command and return the stdout.
-------------------------------------------------------------------------------------
function execute (command)

    local file = io.popen (command)
    local data = file:read ("*a")
    file:close()

    -- We want to return nil instead of a empty string for easier debugging.
    if (data == "") then
        data = nil
    end

    return data
end

In you example, this is how the Lua code would look like:

local command = "curl -X POST -d @req.txt http://example.org/server"
local output = execute (command)

Hi and a big Thank you mcvflorin,

My apologies for my questions, but I have to make some progresses with my vera2. I discover more and more, I will see what I will do with it days after days. Vera is a very great device with big potential if we create some plugins.

Does I have to create the function execute (command) or it is already in vera functions (you say use so I think, it’s already there)?

Where I can find others functions for the vera2 ?

Thank you again.

That function doesn’t exist, you must create it. The best place to see some functions is on code.mios.com, in the plugins.

Oh yes,

This is a simple code but it works, my lua script can launch un shell command.

So I have to read more lua informations and vera code to do what I want.

I can see fa away my solution working. I’m happy.

Thank you. How can I solve my post ?