lua-users home
lua-l archive

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

I'm trying to build a module that will access IDEone, which itself uses a SOAP interface.  Here's the script I'm using to access it:

This seems to work in that: a) it creates network activity and b) it gets a response that is sensible for the input.  But something inside client.lua crashes while trying to decode, so this is what I get:

lua5.1: /usr/share/lua/5.1/soap/client.lua:96: Error while decoding: /usr/share/lua/5.1/soap.lua:239: attempt to index local 'o' (a nil value)
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ns1="" xmlns:xsi="" xmlns:xsd="" xmlns:ns2="" xmlns:SOAP-ENC="" SOAP-ENV:encodingStyle=""><SOAP-ENV:Body><ns1:createSubmissionResponse><return xsi:type="ns2:Map"><item><key xsi:type="xsd:string">error</key><value xsi:type="xsd:string">OK</value></item><item><key xsi:type="xsd:string">link</key><value xsi:type="xsd:string">YqgSR5</value></item></return></ns1:createSubmissionResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

stack traceback:
[C]: in function 'assert'
/usr/share/lua/5.1/soap/client.lua:96: in function 'call'
junk.lua:3: in main chunk
[C]: ?
<?xml version="1.0" encoding="UTF-8"?>

Parsing that returned XML by hand I'm seeing what I expect:

error → OK
link → YqgSR5

Sure enough, if I hit I have my humble little submission.  It appears that the actual SOAP transmission and reception is doing fine.

How do I take this to the next step of not having the call function crash?

LuaSOAP version is 3.0 using Lua 5.1.5 running on Linux Mint 15.

"Perhaps people don't believe this, but throughout all of the discussions of entering China our focus has really been what's best for the Chinese people. It's not been about our revenue or profit or whatnot."
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.