From: James Britt Date: 2008-04-01T05:23:08+09:00 Subject: Re: Make Soap Body tag self closing? jammendolia wrote: > Hello all, > > I posted this question last week in the soap4r group but haven't > received any replies. So I'm hoping maybe someone here can help. > > My situation is this; I 've generated the default/driver/ > mappingRegistry using wsdl2ruby for a client that will consume .Net > web service > > I have created a customized SOAP::Filter::Handler that takes care of > assigning the soap: namespace to the elements, and I've created a > customized SOAP::Header::Handler that takes care of the custom auth > header elements. So far, so good. > > I've compared the generated request between a working .Net client and > my ruby client, and they are virtually identical with one exception; > for the initial authentication call (e.g. signon), there is no payload > in the soap:Body. The .Net client generates this empty body as > (self closing) whereas the ruby version generates > . > ... > So, my question is; Is there any way to override the default behavior > in soap4r to make it render the empty body with a self closing tag > ()? > A hack: take the final XML and do a string substitution. final_xml.sub!( '', '') untested, YMMV, etc. -- James Britt http://www.ruby-doc.org - Ruby Help & Documentation http://www.rubystuff.com - The Ruby Store for Ruby Stuff