Changeset 1949
- Timestamp:
- 09/10/07 21:13:35 (8 months ago)
- Files:
-
- trunk/lib/soap/mapping/literalregistry.rb (modified) (1 diff)
- trunk/lib/soap/mapping/registry.rb (modified) (1 diff)
- trunk/lib/soap/mapping/wsdlliteralregistry.rb (modified) (1 diff)
- trunk/test/soap/test_extraattr.rb (modified) (3 diffs)
- trunk/test/wsdl/anonymous/expectedClassDef.rb (modified) (2 diffs)
- trunk/test/wsdl/any/expectedEcho.rb (modified) (1 diff)
- trunk/test/wsdl/document/test_rpc.rb (modified) (2 diffs)
- trunk/test/wsdl/ref/expectedProduct.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/soap/mapping/literalregistry.rb
r1942 r1949 320 320 attributes.each do |qname, class_name| 321 321 attr = node.extraattr[qname] 322 next if attr.nil? or attr.empty?322 next if attr.nil? 323 323 child = attr 324 324 if class_name trunk/lib/soap/mapping/registry.rb
r1942 r1949 241 241 if typedef.attributes 242 242 typedef.attributes.each do |qname, param| 243 ele.extraattr[qname] = get_xmlattr_value(obj, qname) 243 value = get_xmlattr_value(obj, qname) 244 ele.extraattr[qname] = value unless value.nil? 244 245 end 245 246 end trunk/lib/soap/mapping/wsdlliteralregistry.rb
r1942 r1949 232 232 if typedef.attributes 233 233 typedef.attributes.each do |at| 234 ele.extraattr[at.name] = get_xmlattr_value(obj, at.name) 234 value = get_xmlattr_value(obj, at.name) 235 ele.extraattr[at.name] = value unless value.nil? 235 236 end 236 237 end trunk/test/soap/test_extraattr.rb
r1937 r1949 18 18 Id="extraattr"></n1:headeritem> 19 19 </env:Header> 20 <env:Body Id="extraattr ">20 <env:Body Id="extraattr<>"> 21 21 <n2:test xmlns:n2="my:foo" 22 22 Id="extraattr"></n2:test> … … 31 31 header.add("test", hi) 32 32 body = SOAP::SOAPBody.new() 33 body.extraattr["Id"] = "extraattr "33 body.extraattr["Id"] = "extraattr<>" 34 34 bi = SOAP::SOAPElement.new(XSD::QName.new("my:foo", "bodyitem")) 35 35 bi.extraattr["Id"] = "extraattr" … … 47 47 assert_equal("extraattr", env.extraattr["Id"]) 48 48 assert_equal("extraattr", header.extraattr["Id"]) 49 assert_equal("extraattr ", body.extraattr["Id"])49 assert_equal("extraattr<>", body.extraattr["Id"]) 50 50 assert_equal("extraattr", header["headeritem"].element.extraattr[XSD::QName.new(nil, "Id")]) 51 51 end trunk/test/wsdl/anonymous/expectedClassDef.rb
r1934 r1949 22 22 23 23 # {urn:lp}loginResponse 24 # loginResult - LoginResponse::LoginResult24 # loginResult - WSDL::Anonymous::LoginResponse::LoginResult 25 25 class LoginResponse 26 26 … … 44 44 45 45 # {urn:lp}login 46 # loginRequest - Login::LoginRequest46 # loginRequest - WSDL::Anonymous::Login::LoginRequest 47 47 class Login 48 48 trunk/test/wsdl/any/expectedEcho.rb
r1934 r1949 25 25 # {urn:example.com:echo-type}setOutputAndCompleteRequest 26 26 # taskId - SOAP::SOAPString 27 # data - SetOutputAndCompleteRequest::C_Data27 # data - WSDL::Any::SetOutputAndCompleteRequest::C_Data 28 28 # participantToken - SOAP::SOAPString 29 29 class SetOutputAndCompleteRequest trunk/test/wsdl/document/test_rpc.rb
r1945 r1949 124 124 @client.wiredump_dev = STDOUT if $DEBUG 125 125 @client.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry 126 126 do_test_with_stub(@client) 127 end 128 129 def test_driver_stub 130 @client = ::WSDL::Document::Docrpc_porttype.new 131 @client.endpoint_url = "http://localhost:#{Port}/" 132 @client.wiredump_dev = STDOUT if $DEBUG 133 do_test_with_stub(@client) 134 end 135 136 def test_nil_attribute 137 @client = ::WSDL::Document::Docrpc_porttype.new 138 @client.endpoint_url = "http://localhost:#{Port}/" 139 @client.wiredump_dev = STDOUT if $DEBUG 140 struct1 = Echo_struct.new("mystring1", now1 = Time.now) 141 struct1.xmlattr_m_attr = nil 142 struct2 = Echo_struct.new("mystr<>ing2", now2 = Time.now) 143 struct2.xmlattr_m_attr = '' 144 echo = Echoele.new(struct1, struct2) 145 echo.xmlattr_attr_string = '' 146 echo.xmlattr_attr_int = nil 147 ret = @client.echo(echo) 148 # struct1 and struct2 are swapped 149 assert_equal('', ret.struct1.xmlattr_m_attr) 150 assert_equal(nil, ret.struct_2.xmlattr_m_attr) 151 assert_equal('', ret.xmlattr_attr_string) 152 assert_equal(nil, ret.xmlattr_attr_int) 153 end 154 155 def do_test_with_stub(client) 127 156 struct1 = Echo_struct.new("mystring1", now1 = Time.now) 128 157 struct1.xmlattr_m_attr = 'myattr1' … … 132 161 echo.xmlattr_attr_string = 'attr_str<>ing' 133 162 echo.xmlattr_attr_int = 5 134 ret = @client.echo(echo)163 ret = client.echo(echo) 135 164 136 165 # struct#m_datetime in a response is a DateTime even though trunk/test/wsdl/ref/expectedProduct.rb
r1944 r1949 135 135 # bag - WSDL::Ref::Product 136 136 # rating - SOAP::SOAPString 137 # comment_1 - ProductBag::Comment_1137 # comment_1 - WSDL::Ref::ProductBag::Comment_1 138 138 # comment_2 - WSDL::Ref::Comment 139 139 # m___point - WSDL::Ref::C__point