First character of input is always downcase

34 views
Skip to first unread message

Thong Nguyen

unread,
Nov 1, 2013, 1:10:23 AM11/1/13
to sav...@googlegroups.com
Hi,

I've installed savon 2.3.0 (gem install savon). When sending request to my WS (upper/lower cases are distinguished), the first character of input param is always downcase:

<?xml version="..../"><env:Body><tns:GetCityWeatherByZIP><tns:zIP>94043</tns:zIP></tns:GetCityWeatherByZIP></env:Body></env:Envelope>
 You can see the "zIP", so the response is always invalid ZIP code.
I found that we need to manually edit this file to resolve it:
C:\Ruby193\lib\ruby\gems\1.9.1\gems\gyoku-1.1.0\lib\gyoku\xml_key.rb
 Remove downcase of this line: LOWER_CAMELCASE = lambda { |key| key[0].chr + CAMELCASE.call(key)[1..-1] }

Hope it will help to resolve any similar cases

Thanks,
Thong Nguyen

Steffen Roller

unread,
Nov 1, 2013, 10:09:15 AM11/1/13
to sav...@googlegroups.com
don't just do that!!

There is a parameter to influence the behaviour.
You need to create your client like this:

client = Savon.client(
    wsdl: "...",
    convert_request_keys_to: :camelcasse, # or :upcase, :none
    log: true,
    log_level: :debug,
   pretty_print_xml: true
)



2013/11/1 Thong Nguyen <ndtho...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Savon" group.
To unsubscribe from this group and stop receiving emails from it, send an email to savonrb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages