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: kepler-project-boun...@lists.luaforge.net
[mailto:kepler-project-boun...@lists.luaforge.net] On Behalf Of McClure,
Timothy J UTCFS
Sent: Tuesday, December 21, 2010 9:26 PM
To: kepler-project@lists.luaforge.net
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
Kepler-Project@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/

Reply via email to