Ian
2008-Jul-11 16:18 UTC
SOAP request formed correctly the first time, extra env:Header/ tag added on subsequent invocations of controller
I have the following code in a controller. New to Rails, so please tell me if I''m doing something here that should be in a different part of the application. The weird thing is that this code works fine ONCE, the first pageload after starting up the application. Every subsequent pageload produces a "org.xml.sax.SAXException: Only one Header element allowed!" error from the remote webservice. Looking at the XML wiredumps, the SOAP request sent the first time is correct, but on subsequent executions the SOAP request has an extra env:Header/ (with the / at the END of the tag) tag right before the env:Body tag. class GethelpnowController < ApplicationController def index require ''wss4r/rpc/wssdriver'' require ''customsimpleheader'' obj = MCWSGateway.new() obj.wiredump_dev = STDERR obj.headerhandler << CustomSimpleHeader.new usernametoken = UsernameToken.new("username","password",:type => ''PLAIN'') obj.security.add_security_token(usernametoken) aq = AuthorRetrieve.new("",00000,"") puts obj.retrieveAuthor(aq) end end Thanks, Ian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---