I figured out the issue by examining the code. It had to do with
namespaces. The following works:
require "soap.client"
local ns, meth, ent = soap.client.call {
namespace = "urn:CustomerInfo",
url = "http://localhost:18081",
soapaction = "",
internal_namespace = "n1",
method = "getCustomerName",
entries = {{tag="nothing"},}
}
for i, elem in ipairs (ent[1]) do
print (elem)
end
Are you planning on releasing luasoap 2.0?
Tim
________________________________
From: [email protected]
[mailto:[email protected]] On Behalf Of McClure,
Timothy J UTCFS
Sent: Tuesday, December 21, 2010 9:26 PM
To: [email protected]
Subject: [Kepler-Project] Right version of LUASOAP Found -
ImplementationIssue Encountered
I was able to find the right version of LUASOAP in old a mailing list
entry. What web site has this version?
I am trying to implement a simple LUASOAP client request and I get the
following SOAP exception reported:
s...@onity:~/customer$ lua < callcust.lua
lua: /usr/local/share/lua/5.1/soap/client.lua:56: 1
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="urn:CustomerInfo"><SOAP-ENV:Body
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP
-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Method
'ns1__getCustomerName' not implemented: method name or namespace not
recognized</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Enve
lope>
stack traceback:
[C]: in function 'assert'
/usr/local/share/lua/5.1/soap/client.lua:56: in function
'call'
stdin:2: in main chunk
[C]: ?
I am calling a simple gSOAP service that returns a string.
This is my LUA Script - must not have something set wrong - I tried
setting the namespace but got the same result
require "soap.client"
local ns, meth, ent = soap.client.call {
url = "http://localhost:18081",
soapaction = "ns1__getCustomerName",
method = "ns1__getCustomerName",
entries = {tag = "string"},
}
print("namespace = ", ns, "element name = ", meth)
for i, elem in ipairs (ent[1]) do
print (elem[1])
end
The C++ client works here is that source:
const char server[] = "http://localhost:18081";
int main(int argc, char **argv)
{ struct soap soap;
soap_init(&soap);
char * result;
if (soap_call_ns1__getCustomerName(&soap, server, NULL, &result))
{ soap_print_fault(&soap, stderr);
soap_print_fault_location(&soap, stderr);
}
else
{
printf("Customer name = %s\n", result);
}
soap_destroy(&soap);
soap_end(&soap);
return 0;
}
////////////////////////////////////////////////////////////////////////
////////
//
// Namespace Definition Table
//
////////////////////////////////////////////////////////////////////////
////////
struct Namespace namespaces[] =
{ { "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/" }, // must
be first
{ "SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/" }, // must
be second
{ "xsi", "http://www.w3.org/1999/XMLSchema-instance",
"http://www.w3.org/*/XMLSchema-instance" },
{ "xsd", "http://www.w3.org/1999/XMLSchema",
"http://www.w3.org/*/XMLSchema" },
{ "ns1", "urn:CustomerInfo" },
{ NULL, NULL }
};
Any idea would be very much appreciated.
Thanks,
Tim
_______________________________________________
Kepler-Project mailing list
[email protected]
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/