From: Wes Shaddix Date: 2005-10-29T01:24:33+09:00 Subject: Re: Soap::RPC::Driver Question Update:: I've got most everything correct now, I just have to figure out how to control the namespace names. Here is my current code : require 'soap/rpc/driver' class CustomerController ENDPOINT = "http://localhost:8080/PrismWebService/PrismAPI.asmx" NAMESPACE = "http://inovaware.com/prism/" def save_customer $KCODE = 'UTF-8' soapProxy = SOAP::RPC::Driver.new(ENDPOINT, NAMESPACE) # don't include the datatype with the request soapProxy.generate_explicit_type = false # add the mothods and their SOAPAction and their arguments soapProxy.add_method_with_soapaction('ContactNew', NAMESPACE + 'ContactNew') soapProxy.add_method_with_soapaction('ContactSave', NAMESPACE + 'ContactSave', 'contact') # soapProxy.wiredump_dev = STDERR contact = soapProxy.ContactNew contact.firstName = "WesTestFromRuby" contact.lastName = "ShaddixTestFromRuby" contactKey = soapProxy.ContactSave(contact) puts(contactKey) end end c = CustomerController.new c.save_customer Here is the soap request that is failing:: - - - - WesTestFromRuby ShaddixTestFromRuby 0 And here is a soap request that works :: - - - - WesTest ShaddixTest 0 I need to figure out how to change the namespace names of the envelope, body, and ContactSave elements and it *should* work I think. Thanks for the help. -----Original Message----- From: NAKAMURA, Hiroshi [mailto:nakahiro@sarion.co.jp] Sent: Thursday, October 27, 2005 8:41 PM To: ruby-talk ML Subject: Re: Soap::RPC::Driver Question -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Wes Shaddix wrote: > How do you make the soap client send utf-8 encoded instead of ascii encoded > requests? Set $KCODE = 'UTF8' if you don't have iconv or uconv been installed. Soap4r should detect iconv and uconv and use utf-8 by itself. i.e. $KCODE = 'UTF8' drv = ... or ruby -Ku myclient.rb > How do you keep the request serialization from including the data type of > each element? Please set Driver#generate_explicit_type = false. i.e. drv = SOAP::RPC::Driver.new(...) drv.add_method('my_method', ...) drv.generate_explicit_type = false drv.my_method(...) Regards, // NaHi -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Cygwin) iD8DBQFDYXN5f6b33ts2dPkRApKxAKDAV0ZOIgb08lXsBYdYB9r6rfzKLwCfcM66 i0f7rTV9iZwGq3rzTFuNkWY= =gLgO -----END PGP SIGNATURE-----