lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi all,

I'm trying to write a lua script to query a wsdl using luasoap 3.0, but I'm being unable to have it working.

The request seems ok, as the WS replies what I think it's a correct response, but luasoap fails when decoding it. I applied the patch released here: https://github.com/tomasguisasola/luasoap/issues/4 but I'm getting the same error.

Do you have any advice or any clues of what should I look into?
Thanks in advance.


The error I'm getting:

lua: /usr/local/share/lua/5.1/soap/client.lua:96: Error while decoding: /usr/local/share/lua/5.1/soap.lua:249: Couldn't find SOAP Body!

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns2:validatePinResponse xmlns:ns2="http://ws.EDITED.com/pin/domain"><ns2:valid>false</ns2:valid></ns2:validatePinResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
stack traceback:
[C]: in function 'assert'
/usr/local/share/lua/5.1/soap/client.lua:96: in function 'call'
soap-1-validatePin.lua:18: in main chunk
[C]: ?


And this is my code:

local client = require "soap.client"
local request = {
  url = "" href="http://EDITED.com:8080/EDITED.wsdl">http://EDITED.com:8080/EDITED.wsdl",
  soapaction = "doubler",
  namespace = "http://ws.EDITED.com/pin/domain",
  method = "validatePinRequest",
  entries = {
    { tag = "pin", 1234567899 },
  },
}

local ns, meth, ent = client.call (request)
for i, elem in ipairs (ent[1]) do
  print (elem[1])
end



--
Regards,
David.