File: test-http.lua

package info (click to toggle)
lua-soap 3.0%2Bgit91419a7-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 184 kB
  • ctags: 65
  • sloc: makefile: 22
file content (25 lines) | stat: -rwxr-xr-x 688 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-- $Id: test-http.lua,v 1.4 2009/07/22 19:02:46 tomas Exp $

local soap_client = require"soap.client"

local request = {
  url = "http://validator.soapware.org",
  soapaction = "/validator1",
  namespace = nil,
  method = "easyStructTest",
  entries = {
    {
      tag = "stooges",
      { tag = "curly", attr = { "xsi:type", ["xsi:type"] = "xsd:int", }, -5 },
      { tag = "larry", attr = { "xsi:type", ["xsi:type"] = "xsd:int", }, 5 },
      { tag = "moe",   attr = { "xsi:type", ["xsi:type"] = "xsd:int", }, 41 },
    },
  }
}

local ns, meth, ent = soap_client.call (request)
assert(tonumber(ent[2][1]) == 41)

request.entries[1][2][1] = "abc"
soap_client.call (request)
print"Ok!"