New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugs in response processing #4
Comments
|
Patch for issue 1-3 diff --git a/src/soap.lua b/src/soap.lua
index 79c577b..7f5da83 100755
--- a/src/soap.lua
+++ b/src/soap.lua
@@ -212,7 +212,7 @@ local function list_children (obj, tag)
return v
end
i = i+1
- v = self[i]
+ v = obj[i]
end
return nil
end
@@ -232,12 +232,18 @@ local function decode (doc)
local namespace = find_xmlns (obj.attr)
local lc = list_children (obj)
local o = lc ()
- -- Skip SOAP:Header
- while o and o.tag ~= ns..":Header" and o.tag ~= "SOAP-ENV:Header" do
+
+ -- Skip (optional) SOAP:Header
+ while o
+ and o.tag ~= ns..":Header" and o.tag ~= "SOAP-ENV:Header"
+ and o.tag ~= ns..":Body" and o.tag ~= "SOAP-ENV:Body"
+ do
o = lc ()
end
- if o.tag == ns..":Body" or o.tag == "SOAP-ENV:Body" then
- obj = list_children (o)
+
+ if o and (o.tag == ns..":Body" or o.tag == "SOAP-ENV:Body") then
+ local lo = list_children(o)
+ obj = lo() -- get first child
else
error ("Couldn't find SOAP Body!")
end
|
|
@fpaquet do you can attach the soap reply (raw) with optional header ? |
|
Hello Denis I'm not sure wether i can reproduce today the SOAP reply that we got in 2012. LuaSOAP is running absolutely fine with the patch since several years now. The patch fixes 3 errors while retaining 100% compatibility with previous behaviour. |
We found 3 issues with luasoap 3.0 (latest)
error: soap.lua:215: attempt to index global 'self' (a nil value)
if SOAP-ENV:Header is missing, decode() will fail to locate the SOAP-ENV:Body
error: soap.lua:~251: attempt to index local 'obj' (a function value)
that you add something like list_children() to the public interface of soap
The text was updated successfully, but these errors were encountered: