lib/soap/rpc/proxy.rb in soap4r-1.5.7 vs lib/soap/rpc/proxy.rb in soap4r-1.5.8
- old
+ new
@@ -30,10 +30,11 @@
attr_accessor :soapaction
attr_accessor :mandatorycharset
attr_accessor :allow_unqualified_element
attr_accessor :default_encodingstyle
attr_accessor :generate_explicit_type
+ attr_accessor :use_default_namespace
attr_accessor :return_response_as_xml
attr_reader :headerhandler
attr_reader :filterchain
attr_reader :streamhandler
@@ -50,13 +51,15 @@
initialize_streamhandler(@protocol_option)
@operation = {}
@operation_by_qname = {}
@operation_by_soapaction = {}
@mandatorycharset = nil
+ # TODO: set to false by default or drop thie option in 1.6.0
@allow_unqualified_element = true
@default_encodingstyle = nil
@generate_explicit_type = true
+ @use_default_namespace = false
@return_response_as_xml = false
@headerhandler = Header::HandlerSet.new
@filterchain = Filter::FilterChain.new
@mapping_registry = nil
@literal_mapping_registry = ::SOAP::Mapping::LiteralRegistry.new
@@ -127,19 +130,17 @@
reqopt = create_encoding_opt(
:soapaction => op_info.soapaction || @soapaction,
:envelopenamespace => @options["soap.envelope.requestnamespace"],
:default_encodingstyle =>
@default_encodingstyle || op_info.request_default_encodingstyle,
- :elementformdefault => op_info.elementformdefault,
- :attributeformdefault => op_info.attributeformdefault
+ :use_default_namespace =>
+ op_info.use_default_namespace || @use_default_namespace
)
resopt = create_encoding_opt(
:envelopenamespace => @options["soap.envelope.responsenamespace"],
:default_encodingstyle =>
- @default_encodingstyle || op_info.response_default_encodingstyle,
- :elementformdefault => op_info.elementformdefault,
- :attributeformdefault => op_info.attributeformdefault
+ @default_encodingstyle || op_info.response_default_encodingstyle
)
env = route(req_header, req_body, reqopt, resopt)
if op_info.response_use.nil?
return nil
end
@@ -348,22 +349,23 @@
attr_reader :soapaction
attr_reader :request_style
attr_reader :response_style
attr_reader :request_use
attr_reader :response_use
- attr_reader :elementformdefault
- attr_reader :attributeformdefault
+ attr_reader :use_default_namespace
def initialize(soapaction, param_def, opt)
@soapaction = soapaction
@request_style = opt[:request_style]
@response_style = opt[:response_style]
@request_use = opt[:request_use]
@response_use = opt[:response_use]
- # set nil(unqualified) by default
- @elementformdefault = opt[:elementformdefault]
- @attributeformdefault = opt[:attributeformdefault]
+ @use_default_namespace =
+ opt[:use_default_namespace] || opt[:elementformdefault]
+ if opt.key?(:elementformdefault)
+ warn("option :elementformdefault is deprecated. use :use_default_namespace instead")
+ end
check_style(@request_style)
check_style(@response_style)
check_use(@request_use)
check_use(@response_use)
if @request_style == :rpc
@@ -487,10 +489,11 @@
types = method.get_paramtypes(names)
params = {}
idx = 0
names.each do |name|
params[name] = Mapping.obj2soap(values[idx], mapping_registry,
- types[idx] || XSD::QName.new, opt)
+ types[idx], opt)
+ params[name].elename = XSD::QName.new(nil, name)
idx += 1
end
method.set_param(params)
method
end