lua-users home
lua-l archive

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


	Hi José Francisco

On Wed, 10 Oct 2012, José Francisco Luis Medina wrote:
local client = require "soap.client"
local ns, meth, ent = client.call {
        url = "http://localhost:8080/Directorio/ServicioDirectorio";,
        soapaction = "",
        method = "listarAlcaldia",

entries = {
        ["attr"] = {
        },
        [1] = "2010-01-01",
        ["tag"] = "fecha",
} }
	Certainly you have to add another table inside entries.  Take a
look at the example.  Also, you shouldn't define soapaction as an empty
string; let it nil if you're using SOAP version 1.2.  In your case,
the code should look like that:

...
local ns, meth, ent = client.call {
	url = "http://localhost:8080/Directorio/ServicioDirectorio";,
	--soapaction = "", -- don't do that!
	soapversion = 1.2, -- you should check that!
	method = "listarAlcaldia",
	entries = {
		{ tag = "fecha", "2010-01-01", },
} }

	(I wrote the code succintly, but this is a matter of taste :-)
	Do you have a public URL?  I can check it for you...

and returns me:


<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns: S="http://schemas.xmlsoap.org/soap/envelope/";><S:Body><S:Fault xmlns: ns4="http://www.w3.org/2003/05/soap-envelope";><faultcode>S:Client</faultcode><faultstring>Cannot find dispatch method for {}listarAlcaldia</faultstring></S:Fault></S:Body></S:Envelope>
stack traceback:
    [C]: in function 'assert'
    /usr/share/lua/5.1/soap/client.lua:93: in function 'call'
    lua_client.lua:2: in main chunk
    [C]: ?
	The actual error message is "Cannot find dispatch method for
{}listarAlcaldia", which seems strange.  It could be a problem with the
SOAP version (version 1.1 had a mandatory SOAPAction header, but version
1.2 remove it).  Can you check that?

	Regards,
		Tomás