Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* when there are 2 unqualified anonymous elements which have the sam…

…e name in a SOAP message, mapper cannot decode it to the correct object. introduced :is_anonymous in mapping_registry and do not search registry with anonymous element. closes #355.

git-svn-id: http://dev.ctor.org/svn/soap4r/trunk@1979 23c4dcf6-64ea-0310-84d7-d424c7495ec0
  • Loading branch information...
commit d3785e9e71e2b08be24464dbb6fa960a5fcb2c81 1 parent 426d5c0
@nahi nahi authored
View
4 lib/soap/mapping/mapping.rb
@@ -437,6 +437,7 @@ def self.schema_definition_classdef(klass)
definition = create_schema_definition(klass,
:schema_name => schema_name,
:schema_type => schema_type,
+ :is_anonymous => false,
:schema_qualified => qualified,
:schema_element => elements,
:schema_attribute => attributes
@@ -449,6 +450,7 @@ def self.create_schema_definition(klass, definition)
schema_ns = definition[:schema_ns]
schema_name = definition[:schema_name]
schema_type = definition[:schema_type]
+ is_anonymous = definition[:is_anonymous]
schema_basetype = definition[:schema_basetype]
# wrap if needed for backward compatibility
if schema_ns
@@ -459,7 +461,7 @@ def self.create_schema_definition(klass, definition)
schema_qualified = definition[:schema_qualified]
schema_element = definition[:schema_element]
schema_attributes = definition[:schema_attribute]
- definition = SchemaDefinition.new(klass, schema_name, schema_type, schema_qualified)
+ definition = SchemaDefinition.new(klass, schema_name, schema_type, is_anonymous, schema_qualified)
definition.basetype = schema_basetype
definition.attributes = schema_attributes
if schema_element
View
2  lib/soap/mapping/registry.rb
@@ -186,7 +186,7 @@ def register(definition)
if !@class_schema_definition[obj_class] or definition.type
@class_schema_definition[obj_class] = definition
end
- if definition.elename
+ if definition.elename and !definition.is_anonymous?
@class_elename_schema_definition[obj_class] = definition
@elename_schema_definition[definition.elename] = definition
end
View
7 lib/soap/mapping/schemadefinition.rb
@@ -145,16 +145,21 @@ class SchemaDefinition
attr_accessor :attributes
attr_accessor :elements
- def initialize(class_for, elename, type, qualified)
+ def initialize(class_for, elename, type, anonymous, qualified)
@class_for = class_for
@elename = elename
@type = type
+ @anonymous = anonymous
@qualified = qualified
@basetype = nil
@elements = EMPTY
@attributes = nil
end
+ def is_anonymous?
+ @anonymous
+ end
+
def choice?
@elements.choice?
end
View
27 lib/wsdl/soap/encodedMappingRegistryCreator.rb
@@ -51,32 +51,21 @@ def dump(varname)
def dump_complextype
@complextypes.collect { |type|
- dump_complextypedef(@modulepath, type.name, type) unless type.abstract
+ unless type.abstract
+ dump_with_inner {
+ dump_complextypedef(@modulepath, type.name, type, nil, :encoded => true)
+ }
+ end
}.compact.join("\n")
end
def dump_simpletype
@simpletypes.collect { |type|
- dump_simpletypedef(@modulepath, type.name, type)
+ dump_with_inner {
+ dump_simpletypedef(@modulepath, type.name, type, nil, :encoded => true)
+ }
}.compact.join("\n")
end
-
- def dump_complextypedef(mpath, qname, typedef)
- case typedef.compoundtype
- when :TYPE_STRUCT, :TYPE_EMPTY
- dump_struct_typemap(mpath, qname, typedef)
- when :TYPE_ARRAY
- dump_array_typemap(mpath, qname, typedef, :encoded => true)
- when :TYPE_SIMPLE
- dump_simple_typemap(mpath, qname, typedef)
- when :TYPE_MAP
- # mapped as a general Hash
- nil
- else
- raise RuntimeError.new(
- "unknown kind of complexContent: #{typedef.compoundtype}")
- end
- end
end
View
58 lib/wsdl/soap/literalMappingRegistryCreator.rb
@@ -65,61 +65,49 @@ def dump_element
@elements.collect { |ele|
# has the definition different from the complexType of the same name
next if ele.type.nil? and @complextypes[ele.name]
- qualified = (ele.elementform == 'qualified')
- if ele.local_complextype
- dump_complextypedef(@modulepath, ele.name, ele.local_complextype, nil, qualified)
- elsif ele.local_simpletype
- dump_simpletypedef(@modulepath, ele.name, ele.local_simpletype, nil, qualified)
- elsif ele.type
- if typedef = @complextypes[ele.type]
- dump_complextypedef(@modulepath, ele.type, typedef, ele.name, qualified)
- elsif typedef = @simpletypes[ele.type]
- dump_simpletypedef(@modulepath, ele.type, typedef, ele.name, qualified)
- else
- nil
+ dump_with_inner {
+ if typedef = ele.local_complextype
+ dump_complextypedef(@modulepath, ele.name, typedef)
+ elsif typedef = ele.local_simpletype
+ dump_simpletypedef(@modulepath, ele.name, typedef)
+ elsif ele.type
+ if typedef = @complextypes[ele.type]
+ dump_complextypedef(@modulepath, ele.type, typedef, ele.name)
+ elsif typedef = @simpletypes[ele.type]
+ dump_simpletypedef(@modulepath, ele.type, typedef, ele.name)
+ end
end
- else
- nil
- end
+ }
}.compact.join("\n")
end
def dump_attribute
@attributes.collect { |attr|
if attr.local_simpletype
- dump_simpletypedef(@modulepath, attr.name, attr.local_simpletype)
+ dump_with_inner {
+ dump_simpletypedef(@modulepath, attr.name, attr.local_simpletype)
+ }
end
}.compact.join("\n")
end
def dump_simpletype
@simpletypes.collect { |type|
- dump_simpletypedef(@modulepath, type.name, type)
+ dump_with_inner {
+ dump_simpletypedef(@modulepath, type.name, type)
+ }
}.compact.join("\n")
end
def dump_complextype
@complextypes.collect { |type|
- dump_complextypedef(@modulepath, type.name, type) unless type.abstract
+ unless type.abstract
+ dump_with_inner {
+ dump_complextypedef(@modulepath, type.name, type)
+ }
+ end
}.compact.join("\n")
end
-
- def dump_complextypedef(mpath, qname, typedef, as_element = nil, qualified = false)
- case typedef.compoundtype
- when :TYPE_STRUCT, :TYPE_EMPTY
- dump_struct_typemap(mpath, qname, typedef, as_element, qualified)
- when :TYPE_ARRAY
- dump_array_typemap(mpath, qname, typedef)
- when :TYPE_SIMPLE
- dump_simple_typemap(mpath, qname, typedef, as_element, qualified)
- when :TYPE_MAP
- # mapped as a general Hash
- nil
- else
- raise RuntimeError.new(
- "unknown kind of complexContent: #{typedef.compoundtype}")
- end
- end
end
View
95 lib/wsdl/soap/mappingRegistryCreatorSupport.rb
@@ -18,31 +18,40 @@ module MappingRegistryCreatorSupport
include ClassDefCreatorSupport
include XSD::CodeGen
- def dump_struct_typemap(mpath, qname, typedef, as_element = nil, qualified = nil)
- dump_with_inner {
- dump_complex_typemap(mpath, qname, typedef, as_element, qualified)
- }
- end
-
- def dump_array_typemap(mpath, qname, typedef, opt = {})
- dump_with_inner {
- if typedef.find_soapenc_arytype
- if opt[:encoded]
- dump_encoded_array_typemap(mpath, qname, typedef)
- end
- else
- dump_literal_array_typemap(mpath, qname, typedef)
- end
- }
- end
-
def dump_with_inner
@dump_with_inner = []
@dump_with_inner.unshift(yield)
@dump_with_inner.join("\n")
end
- def dump_complex_typemap(mpath, qname, typedef, as_element = nil, qualified = nil)
+ def dump_complextypedef(mpath, qname, typedef, as_element = nil, opt = {})
+ case typedef.compoundtype
+ when :TYPE_STRUCT, :TYPE_EMPTY
+ dump_complex_typemap(mpath, qname, typedef, as_element, opt)
+ when :TYPE_ARRAY
+ dump_array_typemap(mpath, qname, typedef, opt)
+ when :TYPE_SIMPLE
+ dump_simple_typemap(mpath, qname, typedef, as_element, opt)
+ when :TYPE_MAP
+ # mapped as a general Hash
+ nil
+ else
+ raise RuntimeError.new(
+ "unknown kind of complexContent: #{typedef.compoundtype}")
+ end
+ end
+
+ def dump_array_typemap(mpath, qname, typedef, opt)
+ if typedef.find_soapenc_arytype
+ if opt[:encoded]
+ dump_encoded_array_typemap(mpath, qname, typedef, opt)
+ end
+ else
+ dump_literal_array_typemap(mpath, qname, typedef, opt)
+ end
+ end
+
+ def dump_complex_typemap(mpath, qname, typedef, as_element, opt)
var = {}
var[:class] = mapped_class_name(qname, mpath)
if as_element
@@ -56,13 +65,14 @@ def dump_complex_typemap(mpath, qname, typedef, as_element = nil, qualified = ni
var[:schema_basetype] = typedef.base if typedef.base
schema_ns = qname.namespace
end
+ var[:is_anonymous] = opt[:is_anonymous] if opt.key?(:is_anonymous)
# true, false, or nil
- unless qualified.nil?
- var[:schema_qualified] = qualified.to_s
+ if opt.key?(:qualified)
+ var[:schema_qualified] = opt[:qualified].to_s
end
parentmodule = var[:class]
parsed_element =
- parse_elements(typedef.elements, qname.namespace, parentmodule, qualified)
+ parse_elements(typedef.elements, qname.namespace, parentmodule, opt)
if typedef.choice?
parsed_element.unshift(:choice)
end
@@ -74,7 +84,7 @@ def dump_complex_typemap(mpath, qname, typedef, as_element = nil, qualified = ni
dump_entry(@varname, var)
end
- def dump_simple_typemap(mpath, qname, typedef, as_element = nil, qualified = nil)
+ def dump_simple_typemap(mpath, qname, typedef, as_element, opt)
var = {}
var[:class] = mapped_class_name(qname, mpath)
if as_element
@@ -87,6 +97,7 @@ def dump_simple_typemap(mpath, qname, typedef, as_element = nil, qualified = nil
var[:schema_type] = qname
schema_ns = qname.namespace
end
+ var[:is_anonymous] = opt[:is_anonymous] if opt.key?(:is_anonymous)
unless typedef.attributes.empty?
var[:schema_attribute] = define_attribute(typedef.attributes)
end
@@ -139,7 +150,7 @@ def dump_occurrence(occurrence)
end
end
- def parse_elements(elements, base_namespace, mpath, qualified = false)
+ def parse_elements(elements, base_namespace, mpath, opt)
schema_element = []
any = false
elements.each do |element|
@@ -157,8 +168,11 @@ def parse_elements(elements, base_namespace, mpath, qualified = false)
next if element.ref == SchemaName
typebase = @modulepath
if element.anonymous_type?
- @dump_with_inner << dump_complex_typemap(mpath, element.name,
- element.local_complextype, nil, qualified)
+ child_opt = {
+ :qualified => (element.elementform == 'qualified'),
+ :is_anonymous => true
+ }
+ @dump_with_inner << dump_complextypedef(mpath, element.name, element.local_complextype, nil, child_opt)
typebase = mpath
end
type = create_type_name(typebase, element)
@@ -180,11 +194,11 @@ def parse_elements(elements, base_namespace, mpath, qualified = false)
schema_element << [varname, eleqname, type, occurrence]
when WSDL::XMLSchema::Sequence
child_schema_element =
- parse_elements(element.elements, base_namespace, mpath, qualified)
+ parse_elements(element.elements, base_namespace, mpath, opt)
schema_element << child_schema_element
when WSDL::XMLSchema::Choice
child_schema_element =
- parse_elements(element.elements, base_namespace, mpath, qualified)
+ parse_elements(element.elements, base_namespace, mpath, opt)
if !element.map_as_array?
# choice + maxOccurs="unbounded" is treated just as 'all' now.
child_schema_element.unshift(:choice)
@@ -196,7 +210,7 @@ def parse_elements(elements, base_namespace, mpath, qualified = false)
next
end
child_schema_element =
- parse_elements(element.content.elements, base_namespace, mpath, qualified)
+ parse_elements(element.content.elements, base_namespace, mpath, opt)
schema_element.concat(child_schema_element)
else
raise RuntimeError.new("unknown type: #{element}")
@@ -232,6 +246,7 @@ def dump_entry(regname, var)
dump_entry_item(var, :soap_class),
dump_entry_item(var, :schema_name, :qname),
dump_entry_item(var, :schema_type, :qname),
+ dump_entry_item(var, :is_anonymous),
dump_entry_item(var, :schema_basetype, :qname),
dump_entry_item(var, :schema_qualified),
dump_entry_item(var, :schema_element),
@@ -265,19 +280,19 @@ def dump_entry_item(var, key, dump_type = :none)
end
end
- def dump_simpletypedef(mpath, qname, simpletype, as_element = nil, qualified = false)
+ def dump_simpletypedef(mpath, qname, simpletype, as_element = nil, opt = {})
if simpletype.restriction
- dump_simpletypedef_restriction(mpath, qname, simpletype, as_element, qualified)
+ dump_simpletypedef_restriction(mpath, qname, simpletype, as_element, opt)
elsif simpletype.list
- dump_simpletypedef_list(mpath, qname, simpletype, as_element, qualified)
+ dump_simpletypedef_list(mpath, qname, simpletype, as_element, opt)
elsif simpletype.union
- dump_simpletypedef_union(mpath, qname, simpletype, as_element, qualified)
+ dump_simpletypedef_union(mpath, qname, simpletype, as_element, opt)
else
raise RuntimeError.new("unknown kind of simpletype: #{simpletype}")
end
end
- def dump_simpletypedef_restriction(mpath, qname, typedef, as_element, qualified)
+ def dump_simpletypedef_restriction(mpath, qname, typedef, as_element, opt)
restriction = typedef.restriction
unless restriction.enumeration?
# not supported. minlength?
@@ -295,21 +310,22 @@ def dump_simpletypedef_restriction(mpath, qname, typedef, as_element, qualified)
var[:schema_type] = qname
schema_ns = qname.namespace
end
+ var[:is_anonymous] = opt[:is_anonymous] if opt.key?(:is_anonymous)
assign_const(schema_ns, 'Ns')
dump_entry(@varname, var)
end
- def dump_simpletypedef_list(mpath, qname, typedef, as_element, qualified)
+ def dump_simpletypedef_list(mpath, qname, typedef, as_element, opt)
nil
end
- def dump_simpletypedef_union(mpath, qname, typedef, as_element, qualified)
+ def dump_simpletypedef_union(mpath, qname, typedef, as_element, opt)
nil
end
DEFAULT_ITEM_NAME = XSD::QName.new(nil, 'item')
- def dump_literal_array_typemap(mpath, qname, typedef)
+ def dump_literal_array_typemap(mpath, qname, typedef, opt)
var = {}
var[:class] = mapped_class_name(qname, mpath)
schema_ns = qname.namespace
@@ -320,8 +336,9 @@ def dump_literal_array_typemap(mpath, qname, typedef)
# named complextype
var[:schema_type] = qname
end
+ var[:is_anonymous] = opt[:is_anonymous] if opt.key?(:is_anonymous)
parsed_element =
- parse_elements(typedef.elements, qname.namespace, var[:class], nil)
+ parse_elements(typedef.elements, qname.namespace, var[:class], opt)
if parsed_element.empty?
parsed_element = [create_array_element_definition(typedef, mpath)]
end
@@ -330,7 +347,7 @@ def dump_literal_array_typemap(mpath, qname, typedef)
dump_entry(@varname, var)
end
- def dump_encoded_array_typemap(mpath, qname, typedef)
+ def dump_encoded_array_typemap(mpath, qname, typedef, opt)
arytype = typedef.find_arytype || XSD::AnyTypeName
type = XSD::QName.new(arytype.namespace, arytype.name.sub(/\[(?:,)*\]$/, ''))
return <<__EOD__
View
8 test/wsdl/anonymous/expectedDriver.rb
@@ -15,6 +15,14 @@ class Lp_porttype < ::SOAP::RPC::Driver
{ :request_style => :document, :request_use => :literal,
:response_style => :document, :response_use => :literal,
:faults => {} }
+ ],
+ [ "urn:lp:echo",
+ "echo",
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "urn:lp", "Pack"]],
+ ["out", "parameters", ["::SOAP::SOAPElement", "urn:lp", "Envelope"]] ],
+ { :request_style => :document, :request_use => :literal,
+ :response_style => :document, :response_use => :literal,
+ :faults => {} }
]
]
View
25 test/wsdl/anonymous/expectedMappingRegistry.rb
@@ -27,6 +27,8 @@ module LpMappingRegistry
EncodedRegistry.register(
:class => WSDL::Anonymous::ExtraInfo::Entry,
:schema_name => XSD::QName.new(nil, "Entry"),
+ :is_anonymous => true,
+ :schema_qualified => false,
:schema_element => [
["key", ["SOAP::SOAPString", XSD::QName.new(nil, "Key")]],
["value", ["SOAP::SOAPString", XSD::QName.new(nil, "Value")]]
@@ -44,6 +46,8 @@ module LpMappingRegistry
EncodedRegistry.register(
:class => WSDL::Anonymous::LoginResponse::LoginResult,
:schema_name => XSD::QName.new(nil, "loginResult"),
+ :is_anonymous => true,
+ :schema_qualified => false,
:schema_element => [
["sessionID", "SOAP::SOAPString"]
]
@@ -52,7 +56,6 @@ module LpMappingRegistry
LiteralRegistry.register(
:class => WSDL::Anonymous::Header,
:schema_type => XSD::QName.new(NsLp, "Header"),
- :schema_qualified => false,
:schema_element => [
["header3", ["SOAP::SOAPString", XSD::QName.new(nil, "Header3")]]
]
@@ -69,6 +72,8 @@ module LpMappingRegistry
LiteralRegistry.register(
:class => WSDL::Anonymous::ExtraInfo::Entry,
:schema_name => XSD::QName.new(nil, "Entry"),
+ :is_anonymous => true,
+ :schema_qualified => false,
:schema_element => [
["key", ["SOAP::SOAPString", XSD::QName.new(nil, "Key")]],
["value", ["SOAP::SOAPString", XSD::QName.new(nil, "Value")]]
@@ -78,7 +83,6 @@ module LpMappingRegistry
LiteralRegistry.register(
:class => WSDL::Anonymous::LoginResponse,
:schema_type => XSD::QName.new(NsLp, "loginResponse"),
- :schema_qualified => false,
:schema_element => [
["loginResult", ["WSDL::Anonymous::LoginResponse::LoginResult", XSD::QName.new(nil, "loginResult")]]
]
@@ -87,6 +91,7 @@ module LpMappingRegistry
LiteralRegistry.register(
:class => WSDL::Anonymous::LoginResponse::LoginResult,
:schema_name => XSD::QName.new(nil, "loginResult"),
+ :is_anonymous => true,
:schema_qualified => false,
:schema_element => [
["sessionID", "SOAP::SOAPString"]
@@ -96,7 +101,6 @@ module LpMappingRegistry
LiteralRegistry.register(
:class => WSDL::Anonymous::Pack,
:schema_name => XSD::QName.new(NsLp, "Pack"),
- :schema_qualified => true,
:schema_element => [
["header", ["WSDL::Anonymous::Pack::Header", XSD::QName.new(nil, "Header")]]
]
@@ -105,7 +109,8 @@ module LpMappingRegistry
LiteralRegistry.register(
:class => WSDL::Anonymous::Pack::Header,
:schema_name => XSD::QName.new(nil, "Header"),
- :schema_qualified => true,
+ :is_anonymous => true,
+ :schema_qualified => false,
:schema_element => [
["header1", ["SOAP::SOAPString", XSD::QName.new(nil, "Header1")]]
]
@@ -114,7 +119,6 @@ module LpMappingRegistry
LiteralRegistry.register(
:class => WSDL::Anonymous::Envelope,
:schema_name => XSD::QName.new(NsLp, "Envelope"),
- :schema_qualified => true,
:schema_element => [
["header", ["WSDL::Anonymous::Envelope::Header", XSD::QName.new(nil, "Header")]]
]
@@ -123,7 +127,8 @@ module LpMappingRegistry
LiteralRegistry.register(
:class => WSDL::Anonymous::Envelope::Header,
:schema_name => XSD::QName.new(nil, "Header"),
- :schema_qualified => true,
+ :is_anonymous => true,
+ :schema_qualified => false,
:schema_element => [
["header2", ["SOAP::SOAPString", XSD::QName.new(nil, "Header2")]]
]
@@ -132,7 +137,6 @@ module LpMappingRegistry
LiteralRegistry.register(
:class => WSDL::Anonymous::Login,
:schema_name => XSD::QName.new(NsLp, "login"),
- :schema_qualified => true,
:schema_element => [
["loginRequest", ["WSDL::Anonymous::Login::LoginRequest", XSD::QName.new(nil, "loginRequest")]]
]
@@ -141,7 +145,8 @@ module LpMappingRegistry
LiteralRegistry.register(
:class => WSDL::Anonymous::Login::LoginRequest,
:schema_name => XSD::QName.new(nil, "loginRequest"),
- :schema_qualified => true,
+ :is_anonymous => true,
+ :schema_qualified => false,
:schema_element => [
["username", "SOAP::SOAPString"],
["password", "SOAP::SOAPString"],
@@ -152,7 +157,6 @@ module LpMappingRegistry
LiteralRegistry.register(
:class => WSDL::Anonymous::LoginResponse,
:schema_name => XSD::QName.new(NsLp, "loginResponse"),
- :schema_qualified => true,
:schema_element => [
["loginResult", ["WSDL::Anonymous::LoginResponse::LoginResult", XSD::QName.new(nil, "loginResult")]]
]
@@ -161,7 +165,8 @@ module LpMappingRegistry
LiteralRegistry.register(
:class => WSDL::Anonymous::LoginResponse::LoginResult,
:schema_name => XSD::QName.new(nil, "loginResult"),
- :schema_qualified => true,
+ :is_anonymous => true,
+ :schema_qualified => false,
:schema_element => [
["sessionID", "SOAP::SOAPString"]
]
View
22 test/wsdl/anonymous/lp.wsdl
@@ -97,11 +97,23 @@
<part name="parameters" element="tns:loginResponse" />
</message>
+ <message name="echo_in">
+ <part name="parameters" element="tns:Pack" />
+ </message>
+ <message name="echo_out">
+ <part name="parameters" element="tns:Envelope" />
+ </message>
+
<portType name="lp_porttype">
<operation name="login">
<input message="tns:login_in" />
<output message="tns:login_out" />
</operation>
+
+ <operation name="echo">
+ <input message="tns:echo_in" />
+ <output message="tns:echo_out" />
+ </operation>
</portType>
<binding name="lp_binding" type="tns:lp_porttype">
@@ -115,6 +127,16 @@
<soap:body use="literal" />
</output>
</operation>
+
+ <operation name="echo">
+ <soap:operation soapAction="urn:lp:echo" style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
</binding>
<service name="lp_service">
View
26 test/wsdl/anonymous/test_anonymous.rb
@@ -22,6 +22,14 @@ def on_init
XSD::QName.new(Namespace, 'login'),
XSD::QName.new(Namespace, 'loginResponse')
)
+ add_document_method(
+ self,
+ Namespace + ':echo',
+ 'echo',
+ XSD::QName.new(Namespace, 'Pack'),
+ XSD::QName.new(Namespace, 'Envelope')
+ )
+ self.literal_mapping_registry = LpMappingRegistry::LiteralRegistry
end
def login(arg)
@@ -29,14 +37,20 @@ def login(arg)
sess = [req.username, req.password, req.timezone].join
LoginResponse.new(LoginResponse::LoginResult.new(sess))
end
+
+ def echo(pack)
+ raise unless pack.class == Pack
+ raise unless pack.header.class == Pack::Header
+ Envelope.new(Envelope::Header.new(pack.header.header1))
+ end
end
DIR = File.dirname(File.expand_path(__FILE__))
Port = 17171
def setup
- setup_server
setup_clientdef
+ setup_server
@client = nil
end
@@ -98,6 +112,16 @@ def test_stub
assert_equal(LoginResponse::LoginResult, response.loginResult.class)
assert_equal("usernamepasswordtz", response.loginResult.sessionID)
end
+
+ def test_anonymous_mapping
+ @client = Lp_porttype.new("http://localhost:#{Port}/")
+ @client.wiredump_dev = STDERR if $DEBUG
+ request = Pack.new(Pack::Header.new("pack_header"))
+ response = @client.echo(request)
+ assert_equal(Envelope, response.class)
+ assert_equal(Envelope::Header, response.header.class)
+ assert_equal("pack_header", response.header.header2)
+ end
end
View
6 test/wsdl/any/expectedMappingRegistry.rb
@@ -22,7 +22,6 @@ module EchoMappingRegistry
LiteralRegistry.register(
:class => WSDL::Any::FooBar,
:schema_type => XSD::QName.new(NsEchoType, "foo.bar"),
- :schema_qualified => false,
:schema_element => [
["before", ["SOAP::SOAPString", XSD::QName.new(nil, "before")]],
["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]],
@@ -33,7 +32,6 @@ module EchoMappingRegistry
LiteralRegistry.register(
:class => WSDL::Any::FooBar,
:schema_name => XSD::QName.new(NsEchoType, "foo.bar"),
- :schema_qualified => true,
:schema_element => [
["before", ["SOAP::SOAPString", XSD::QName.new(nil, "before")]],
["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]],
@@ -44,7 +42,6 @@ module EchoMappingRegistry
LiteralRegistry.register(
:class => WSDL::Any::SetOutputAndCompleteRequest,
:schema_name => XSD::QName.new(NsEchoType, "setOutputAndCompleteRequest"),
- :schema_qualified => true,
:schema_element => [
["taskId", ["SOAP::SOAPString", XSD::QName.new(nil, "taskId")]],
["data", ["WSDL::Any::SetOutputAndCompleteRequest::C_Data", XSD::QName.new(nil, "data")]],
@@ -55,7 +52,8 @@ module EchoMappingRegistry
LiteralRegistry.register(
:class => WSDL::Any::SetOutputAndCompleteRequest::C_Data,
:schema_name => XSD::QName.new(nil, "data"),
- :schema_qualified => true,
+ :is_anonymous => true,
+ :schema_qualified => false,
:schema_element => [
["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]]
]
View
2  test/wsdl/group/expectedMappingRegistry.rb
@@ -30,7 +30,6 @@ module EchoMappingRegistry
LiteralRegistry.register(
:class => WSDL::Group::Groupele_type,
:schema_type => XSD::QName.new(NsGrouptype, "groupele_type"),
- :schema_qualified => false,
:schema_element => [
["comment", "SOAP::SOAPString", [0, 1]],
["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]],
@@ -49,7 +48,6 @@ module EchoMappingRegistry
LiteralRegistry.register(
:class => WSDL::Group::Groupele_type,
:schema_name => XSD::QName.new(NsGrouptype, "groupele"),
- :schema_qualified => true,
:schema_element => [
["comment", "SOAP::SOAPString", [0, 1]],
["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]],
View
4 test/wsdl/raa/expectedMappingRegistry.rb
@@ -72,7 +72,6 @@ module RAAMappingRegistry
LiteralRegistry.register(
:class => WSDL::RAA::Category,
:schema_type => XSD::QName.new(NsC_002, "Category"),
- :schema_qualified => false,
:schema_element => [
["major", ["SOAP::SOAPString", XSD::QName.new(nil, "major")]],
["minor", ["SOAP::SOAPString", XSD::QName.new(nil, "minor")]]
@@ -82,7 +81,6 @@ module RAAMappingRegistry
LiteralRegistry.register(
:class => WSDL::RAA::Product,
:schema_type => XSD::QName.new(NsC_002, "Product"),
- :schema_qualified => false,
:schema_element => [
["id", ["SOAP::SOAPInt", XSD::QName.new(nil, "id")]],
["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]],
@@ -99,7 +97,6 @@ module RAAMappingRegistry
LiteralRegistry.register(
:class => WSDL::RAA::Owner,
:schema_type => XSD::QName.new(NsC_002, "Owner"),
- :schema_qualified => false,
:schema_element => [
["id", ["SOAP::SOAPInt", XSD::QName.new(nil, "id")]],
["email", ["SOAP::SOAPAnyURI", XSD::QName.new(nil, "email")]],
@@ -110,7 +107,6 @@ module RAAMappingRegistry
LiteralRegistry.register(
:class => WSDL::RAA::Info,
:schema_type => XSD::QName.new(NsC_002, "Info"),
- :schema_qualified => false,
:schema_element => [
["category", ["WSDL::RAA::Category", XSD::QName.new(nil, "category")]],
["product", ["WSDL::RAA::Product", XSD::QName.new(nil, "product")]],
View
2  test/wsdl/simpletype/rpc/expectedMappingRegistry.rb
@@ -33,7 +33,6 @@ module Echo_versionMappingRegistry
LiteralRegistry.register(
:class => Version_struct,
:schema_type => XSD::QName.new(NsSimpletypeRpcType, "version_struct"),
- :schema_qualified => false,
:schema_element => [
["version", ["Version", XSD::QName.new(nil, "version")]],
["msg", ["SOAP::SOAPString", XSD::QName.new(nil, "msg")]]
@@ -54,4 +53,5 @@ module Echo_versionMappingRegistry
:class => ZipIntType,
:schema_type => XSD::QName.new(NsSimpletypeRpcType, "zipIntType")
)
+
end
View
1  test/wsdl/soap/wsdl2ruby/expectedMappingRegistry.rb
@@ -23,7 +23,6 @@ module Echo_versionMappingRegistry
LiteralRegistry.register(
:class => Version_struct,
:schema_type => XSD::QName.new(NsSimpletypeRpcType, "version_struct"),
- :schema_qualified => false,
:schema_element => [
["version", ["Version", XSD::QName.new(nil, "version")]],
["msg", ["SOAP::SOAPString", XSD::QName.new(nil, "msg")]]
View
3  test/xsd/xsd2ruby/expected_mysample_mapping_registry.rb
@@ -10,7 +10,6 @@ module MysampleMappingRegistry
Registry.register(
:class => XSD::XSD2Ruby::Question,
:schema_type => XSD::QName.new(NsMysample, "question"),
- :schema_qualified => false,
:schema_element => [
["something", ["SOAP::SOAPString", XSD::QName.new(nil, "something")]]
]
@@ -19,7 +18,6 @@ module MysampleMappingRegistry
Registry.register(
:class => XSD::XSD2Ruby::Section,
:schema_type => XSD::QName.new(NsMysample, "section"),
- :schema_qualified => false,
:schema_element => [
["sectionID", ["SOAP::SOAPInt", XSD::QName.new(nil, "sectionID")]],
["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]],
@@ -40,7 +38,6 @@ module MysampleMappingRegistry
Registry.register(
:class => XSD::XSD2Ruby::SectionElement,
:schema_name => XSD::QName.new(NsMysample, "sectionElement"),
- :schema_qualified => true,
:schema_element => [
["sectionID", ["SOAP::SOAPInt", XSD::QName.new(nil, "sectionID")]],
["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]],
Please sign in to comment.
Something went wrong with that request. Please try again.