Changeset 2008
- Timestamp:
- 02/10/08 10:48:23 (7 months ago)
- Files:
-
- branches/1_5/lib/soap/baseData.rb (modified) (2 diffs)
- branches/1_5/lib/soap/encodingstyle/literalHandler.rb (modified) (1 diff)
- branches/1_5/lib/soap/generator.rb (modified) (1 diff)
- branches/1_5/lib/soap/mapping/literalregistry.rb (modified) (1 diff)
- branches/1_5/lib/soap/mapping/wsdlliteralregistry.rb (modified) (1 diff)
- branches/1_5/lib/soap/rpc/proxy.rb (modified) (2 diffs)
- branches/1_5/lib/xsd/mapping.rb (modified) (1 diff)
- branches/1_5/test/wsdl/rpc/test_rpc_lit.rb (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1_5/lib/soap/baseData.rb
r1970 r2008 49 49 attr_reader :extraattr 50 50 attr_accessor :definedtype 51 attr_accessor :force_typed 51 52 52 53 def initialize(*arg) … … 61 62 @definedtype = nil 62 63 @extraattr = {} 64 @force_typed = false 63 65 end 64 66 branches/1_5/lib/soap/encodingstyle/literalHandler.rb
r1975 r2008 30 30 attrs = {} 31 31 name = generator.encode_name(ns, data, attrs) 32 if data.type and data.type.name and 33 (@generate_explicit_type or data.force_typed) 34 data.extraattr[XSD::AttrTypeName] = data.type 35 end 32 36 data.extraattr.each do |key, value| 33 next if !@generate_explicit_type and key == XSD::AttrTypeName34 37 keytag = key 35 38 if key.is_a?(XSD::QName) branches/1_5/lib/soap/generator.rb
r1975 r2008 142 142 else 143 143 if obj.is_a?(SOAPEnvelope) 144 # xsi:nil="true" can appear even if dumping without explicit type.145 144 Generator.assign_ns(attrs, ns, XSD::InstanceNamespace) 146 if @generate_explicit_type 147 Generator.assign_ns(attrs, ns, XSD::Namespace) 148 end 145 Generator.assign_ns(attrs, ns, XSD::Namespace) 149 146 end 150 147 obj.encode(self, ns, attrs) do |child| branches/1_5/lib/soap/mapping/literalregistry.rb
r1991 r2008 137 137 end 138 138 ele.qualified = definition.qualified 139 if definition.type and (definition.basetype or Mapping.root_type_hint) 140 Mapping.reset_root_type_hint 141 ele.extraattr[XSD::AttrTypeName] = definition.type 139 if definition.type 140 ele.type = definition.type 141 if definition.basetype or Mapping.root_type_hint 142 Mapping.reset_root_type_hint 143 ele.force_typed = true 144 end 142 145 end 143 146 if qname.nil? and definition.elename branches/1_5/lib/soap/mapping/wsdlliteralregistry.rb
r1949 r2008 110 110 else 111 111 ele = complexobj2soap(obj, type) 112 end 113 ele.type = type.name 114 if type.base or Mapping.root_type_hint 115 Mapping.reset_root_type_hint 116 ele.force_typed = true 112 117 end 113 118 add_definedattributes2soap(obj, ele, type) branches/1_5/lib/soap/rpc/proxy.rb
r1983 r2008 57 57 @allow_unqualified_element = true 58 58 @default_encodingstyle = nil 59 @generate_explicit_type = true59 @generate_explicit_type = nil 60 60 @use_default_namespace = false 61 61 @return_response_as_xml = false … … 141 141 @default_encodingstyle || op_info.response_default_encodingstyle 142 142 ) 143 if reqopt[:generate_explicit_type].nil? 144 reqopt[:generate_explicit_type] = (op_info.request_use == :encoded) 145 end 146 if resopt[:generate_explicit_type].nil? 147 resopt[:generate_explicit_type] = (op_info.response_use == :encoded) 148 end 143 149 env = route(req_header, req_body, reqopt, resopt) 144 150 if op_info.response_use.nil? branches/1_5/lib/xsd/mapping.rb
r1936 r2008 31 31 MAPPING_OPT = { 32 32 :default_encodingstyle => SOAP::LiteralNamespace, 33 :generate_explicit_type => false, 33 34 :root_type_hint => true 34 35 }.freeze branches/1_5/test/wsdl/rpc/test_rpc_lit.rb
r1983 r2008 156 156 ECHO_STRING_ARRAY_REQUEST = 157 157 %q[<?xml version="1.0" encoding="utf-8" ?> 158 <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 158 <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" 159 xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 159 160 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 160 161 <env:Body> … … 171 172 ECHO_STRING_ARRAY_RESPONSE = 172 173 %q[<?xml version="1.0" encoding="utf-8" ?> 173 <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 174 <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" 175 xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 174 176 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 175 177 <env:Body> … … 199 201 ECHO_STRING_ARRAY_INLINE_REQUEST = 200 202 %q[<?xml version="1.0" encoding="utf-8" ?> 201 <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 203 <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" 204 xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 202 205 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 203 206 <env:Body> … … 214 217 ECHO_STRING_ARRAY_INLINE_RESPONSE = 215 218 %q[<?xml version="1.0" encoding="utf-8" ?> 216 <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 219 <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" 220 xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 217 221 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 218 222 <env:Body> … … 241 245 ECHO_NESTED_STRUCT_REQUEST = 242 246 %q[<?xml version="1.0" encoding="utf-8" ?> 243 <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 247 <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" 248 xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 244 249 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 245 250 <env:Body> … … 261 266 ECHO_NESTED_STRUCT_RESPONSE = 262 267 %q[<?xml version="1.0" encoding="utf-8" ?> 263 <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 268 <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" 269 xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 264 270 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 265 271 <env:Body> … … 300 306 ECHO_NESTED_STRUCT_REQUEST_NIL = 301 307 %q[<?xml version="1.0" encoding="utf-8" ?> 302 <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 308 <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" 309 xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 303 310 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 304 311 <env:Body> … … 319 326 ECHO_NESTED_STRUCT_RESPONSE_NIL = 320 327 %q[<?xml version="1.0" encoding="utf-8" ?> 321 <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 328 <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" 329 xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 322 330 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 323 331 <env:Body> … … 379 387 ECHO_STRUCT_ARRAY_REQUEST = 380 388 %q[<?xml version="1.0" encoding="utf-8" ?> 381 <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 389 <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" 390 xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 382 391 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 383 392 <env:Body> … … 401 410 ECHO_STRUCT_ARRAY_RESPONSE = 402 411 %q[<?xml version="1.0" encoding="utf-8" ?> 403 <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 412 <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" 413 xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 404 414 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 405 415 <env:Body>