Hi NaHi,
Sometimes the soap message contains the empty soap:body,
and the request (or response) argument may be empty.
Initially I added the document method in the following way:
server.
add_document_method('listProducts',
'http://warehouse.acme.com/ws/listProducts',
nil, # emtpy request
XSD::QName.new('http://warehouse.acme.com/ws',
'listProductsResult'))
This then resulted in following :
/usr/lib/ruby/1.8/soap/rpc/element.rb:166:in `create_doc_param_def': undefined m
ethod `each' for nil:NilClass (NoMethodError)
from /usr/lib/ruby/1.8/soap/rpc/driver.rb:148:in `add_document_method'
from WarehouseNoWsdlClient.rb:9
The quick fix is to do :
server.
add_document_method('listProducts',
'http://warehouse.acme.com/ws/listProducts',
[], # emtpy request
XSD::QName.new('http://warehouse.acme.com/ws',
'listProductsResult'))
But perhaps a slightly more defensive code could be used in soap/rpc/driver.rb:
--- /usr/lib/ruby/1.8/soap/rpc/driver.rb 2005-10-26
21:53:24.358155600 -0700
+++ driver.rb 2005-10-26 21:53:24.373780600 -0700
@@ -145,6 +145,8 @@
alias add_method_with_soapaction_as add_rpc_method_with_soapaction_as
def add_document_method(name, soapaction, req_qname, res_qname)
+ req_qname ||= []
+ res_qname ||= []
param_def = SOAPMethod.create_doc_param_def(req_qname, res_qname)
@proxy.add_document_method(soapaction, name, param_def)
add_document_method_interface(name, param_def)
Regards,
emil