summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog61
-rw-r--r--MANIFEST5
-rw-r--r--lib/soap/baseData.rb23
-rw-r--r--lib/soap/element.rb23
-rw-r--r--lib/soap/encodingstyle/aspDotNetHandler.rb23
-rw-r--r--lib/soap/encodingstyle/handler.rb23
-rw-r--r--lib/soap/encodingstyle/literalHandler.rb23
-rw-r--r--lib/soap/encodingstyle/soapHandler.rb111
-rw-r--r--lib/soap/generator.rb23
-rw-r--r--lib/soap/mapping.rb21
-rw-r--r--lib/soap/mapping/factory.rb45
-rw-r--r--lib/soap/mapping/mapping.rb23
-rw-r--r--lib/soap/mapping/registry.rb31
-rw-r--r--lib/soap/mapping/rubytypeFactory.rb21
-rw-r--r--lib/soap/mapping/typeMap.rb23
-rw-r--r--lib/soap/mapping/wsdlRegistry.rb23
-rw-r--r--lib/soap/marshal.rb30
-rw-r--r--lib/soap/netHttpClient.rb63
-rw-r--r--lib/soap/parser.rb23
-rw-r--r--lib/soap/processor.rb23
-rw-r--r--lib/soap/rpc/cgistub.rb23
-rw-r--r--lib/soap/rpc/driver.rb77
-rw-r--r--lib/soap/rpc/element.rb27
-rw-r--r--lib/soap/rpc/proxy.rb36
-rw-r--r--lib/soap/rpc/router.rb23
-rw-r--r--lib/soap/rpc/rpc.rb23
-rw-r--r--lib/soap/rpc/soaplet.rb23
-rw-r--r--lib/soap/rpc/standaloneServer.rb23
-rw-r--r--lib/soap/soap.rb23
-rw-r--r--lib/soap/streamHandler.rb28
-rw-r--r--lib/soap/wsdlDriver.rb87
-rw-r--r--lib/wsdl/binding.rb21
-rw-r--r--lib/wsdl/data.rb21
-rw-r--r--lib/wsdl/definitions.rb26
-rw-r--r--lib/wsdl/documentation.rb23
-rw-r--r--lib/wsdl/import.rb21
-rw-r--r--lib/wsdl/importer.rb22
-rw-r--r--lib/wsdl/info.rb23
-rw-r--r--lib/wsdl/message.rb21
-rw-r--r--lib/wsdl/operation.rb29
-rw-r--r--lib/wsdl/operationBinding.rb25
-rw-r--r--lib/wsdl/param.rb21
-rw-r--r--lib/wsdl/parser.rb23
-rw-r--r--lib/wsdl/part.rb23
-rw-r--r--lib/wsdl/port.rb23
-rw-r--r--lib/wsdl/portType.rb21
-rw-r--r--lib/wsdl/service.rb21
-rw-r--r--lib/wsdl/soap/address.rb23
-rw-r--r--lib/wsdl/soap/binding.rb23
-rw-r--r--lib/wsdl/soap/body.rb23
-rw-r--r--lib/wsdl/soap/complexType.rb45
-rw-r--r--lib/wsdl/soap/data.rb23
-rw-r--r--lib/wsdl/soap/definitions.rb21
-rw-r--r--lib/wsdl/soap/fault.rb23
-rw-r--r--lib/wsdl/soap/header.rb21
-rw-r--r--lib/wsdl/soap/headerfault.rb21
-rw-r--r--lib/wsdl/soap/operation.rb23
-rw-r--r--lib/wsdl/types.rb23
-rw-r--r--lib/wsdl/wsdl.rb23
-rw-r--r--lib/wsdl/xmlSchema/all.rb21
-rw-r--r--lib/wsdl/xmlSchema/any.rb21
-rw-r--r--lib/wsdl/xmlSchema/attribute.rb21
-rw-r--r--lib/wsdl/xmlSchema/choice.rb21
-rw-r--r--lib/wsdl/xmlSchema/complexContent.rb21
-rw-r--r--lib/wsdl/xmlSchema/complexType.rb23
-rw-r--r--lib/wsdl/xmlSchema/content.rb23
-rw-r--r--lib/wsdl/xmlSchema/data.rb21
-rw-r--r--lib/wsdl/xmlSchema/element.rb21
-rw-r--r--lib/wsdl/xmlSchema/import.rb23
-rw-r--r--lib/wsdl/xmlSchema/parser.rb23
-rw-r--r--lib/wsdl/xmlSchema/schema.rb21
-rw-r--r--lib/wsdl/xmlSchema/sequence.rb21
-rw-r--r--lib/wsdl/xmlSchema/unique.rb23
-rw-r--r--lib/xsd/charset.rb29
-rw-r--r--lib/xsd/datatypes.rb23
-rw-r--r--lib/xsd/datatypes1999.rb21
-rw-r--r--lib/xsd/iconvcharset.rb23
-rw-r--r--lib/xsd/namedelements.rb23
-rw-r--r--lib/xsd/ns.rb23
-rw-r--r--lib/xsd/qname.rb21
-rw-r--r--lib/xsd/xmlparser.rb21
-rw-r--r--lib/xsd/xmlparser/parser.rb23
-rw-r--r--lib/xsd/xmlparser/rexmlparser.rb23
-rw-r--r--lib/xsd/xmlparser/xmlparser.rb23
-rw-r--r--lib/xsd/xmlparser/xmlscanner.rb23
-rw-r--r--sample/soap/digraph.rb2
-rw-r--r--sample/wsdl/amazon/wsdlDriver.rb2
-rw-r--r--sample/wsdl/googleSearch/sampleClient.rb2
-rw-r--r--sample/wsdl/googleSearch/wsdlDriver.rb2
-rw-r--r--test/wsdl/axisArray/axisArray.wsdl60
-rw-r--r--test/wsdl/axisArray/itemList.rb27
-rw-r--r--test/wsdl/axisArray/test_axisarray.rb72
-rw-r--r--test/wsdl/emptycomplextype.wsdl94
-rw-r--r--test/wsdl/multiplefault.wsdl68
-rw-r--r--test/wsdl/test_emptycomplextype.rb8
-rw-r--r--test/wsdl/test_multiplefault.rb39
-rw-r--r--test/xsd/test_xmlschemaparser.rb9
-rw-r--r--test/xsd/xmlschema.xml5
98 files changed, 1061 insertions, 1599 deletions
diff --git a/ChangeLog b/ChangeLog
index 7cf5a928b6..0dd4f55bd4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,64 @@
+Tue Nov 25 16:24:42 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * lib/soap/**/*.rb, lib/wsdl/**/*.rb, lib/xsd/**/*.rb: changed license;
+ GPL2 -> Ruby's.
+
+ * lib/soap/rpc/driver.rb, lib/soap/wsdlDriver.rb,
+ lib/soap/streamHandler.rb: add interface to streamhandler.
+
+ * lib/soap/marshal.rb: raise error if parse fails.
+
+ * lib/soap/netHttpClient.rb: add https support. Patched by
+ Oliver M. Bolzer.
+
+ * lib/soap/netHttpClient.rb: dump HTTP response message body by itself.
+
+ * lib/soap/rpc/driver.rb, lib/soap/rpc/proxy.rb,
+ lib/soap/wsdlDriver.rb: add driver#mandatorycharset interface to foce
+ using charset for parsing response from buggy server.
+
+ * lib/soap/encodingstyle/soapHandler.rb: support Apache Axis's half
+ typed multi-ref array.
+
+ * lib/soap/mapping/factory.rb, lib/soap/mapping/registry.rb: map
+ SOAPStruct which has multi-accessors which name are the same, to an
+ array.
+
+ * lib/soap/rpc/element.rb: fixed illegal parameter order.
+
+ * lib/soap/rpc/element.rb: element name of response message could have
+ the name other than 'return'.
+
+ * lib/wsdl/operation.rb, lib/wsdl/operationBinding.rb,
+ lib/wsdl/soap/classDefCreator.rb, lib/wsdl/soap/methodDefCreator.rb,
+ lib/wsdl/soap/methodDefCreatorSupport.rb: WSDL/1.1 allows plural
+ fault definition in a operation. [ruby-talk:84948]
+
+ * test/wsdl/multiplefault.wsdl, test/wsdl/test_multiplefault.rb: add
+ test for above fix.
+
+ * lib/wsdl/soap/complexType.rb: support WSDL array definition with
+ maxOccures="unbound".
+
+ * lib/xsd/charset.rb: use cp932 under emx. Patched by
+ Siena. / SHINAGAWA, Norihide in [ruby-dev:21972]
+
+ * lib/xsd/xmlparser/parser.rb: set @charset nil by default. Nil means
+ 'follow encoding declaration in XML'.
+
+ * sample/soap/digraph.rb, sample/wsdl/amazon/wsdlDriver.rb,
+ sample/wsdl/googleSearch/sampleClient.rb,
+ sample/wsdl/googleSearch/wsdlDriver.rb,
+ test/wsdl/test_emptycomplextype.rb,
+ test/wsdl/marshal/test_wsdlmarshal.rb,
+ test/xsd/test_xmlschemaparser.rb: use File.open(...) { |f| f.read }
+ instead of File.open(...).read. [ruby-dev:21964]
+
+ * test/wsdl/emptycomplextype.wsdl, test/wsdl/test_emptycomplextype.rb:
+ simplify the test case.
+
+ * test/wsdl/axisArray/*: add tests for axis's array encoding.
+
Tue Nov 25 16:15:29 2003 WATANABE Hirofumi <eban@ruby-lang.org>
* ruby.h: don't treat Cygwin as Windows.
diff --git a/MANIFEST b/MANIFEST
index 7a999f353c..be83f95b05 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -725,13 +725,18 @@ test/uri/test_generic.rb
test/uri/test_http.rb
test/uri/test_ldap.rb
test/uri/test_mailto.rb
+test/wsdl/axisArray/axisArray.wsdl
+test/wsdl/axisArray/itemList.rb
+test/wsdl/axisArray/test_axisarray.rb
test/wsdl/emptycomplextype.wsdl
+test/wsdl/multiplefault.wsdl
test/wsdl/raa/RAA.rb
test/wsdl/raa/README.txt
test/wsdl/raa/raa.wsdl
test/wsdl/raa/server.rb
test/wsdl/raa/test_raa.rb
test/wsdl/test_emptycomplextype.rb
+test/wsdl/test_multiplefault.rb
test/xsd/test_xmlschemaparser.rb
test/xsd/test_xsd.rb
test/xsd/xmlschema.xml
diff --git a/lib/soap/baseData.rb b/lib/soap/baseData.rb
index c175072e4d..91f5a0433f 100644
--- a/lib/soap/baseData.rb
+++ b/lib/soap/baseData.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - Base type library
-Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi.
+# soap/baseData.rb: SOAP4R - Base type library
+# Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/datatypes'
@@ -408,7 +397,7 @@ public
private
def add_member(name, value = nil)
- value = SOAPNil.new() unless value
+ value = SOAPNil.new() if value.nil?
@array.push(name)
value.elename = value.elename.dup_name(name)
@data.push(value)
diff --git a/lib/soap/element.rb b/lib/soap/element.rb
index 561cb1b071..ae600a08e2 100644
--- a/lib/soap/element.rb
+++ b/lib/soap/element.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - SOAP elements library
-Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# SOAP4R - SOAP elements library
+# Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/qname'
diff --git a/lib/soap/encodingstyle/aspDotNetHandler.rb b/lib/soap/encodingstyle/aspDotNetHandler.rb
index b00084e3a9..e976433a7b 100644
--- a/lib/soap/encodingstyle/aspDotNetHandler.rb
+++ b/lib/soap/encodingstyle/aspDotNetHandler.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - ASP.NET EncodingStyle handler library
-Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# SOAP4R - ASP.NET EncodingStyle handler library
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'soap/encodingstyle/handler'
diff --git a/lib/soap/encodingstyle/handler.rb b/lib/soap/encodingstyle/handler.rb
index 2cbbd893d8..8ea23ef146 100644
--- a/lib/soap/encodingstyle/handler.rb
+++ b/lib/soap/encodingstyle/handler.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - EncodingStyle handler library
-Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# SOAP4R - EncodingStyle handler library
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'soap/soap'
diff --git a/lib/soap/encodingstyle/literalHandler.rb b/lib/soap/encodingstyle/literalHandler.rb
index 5ff0e5dd66..995e1a5361 100644
--- a/lib/soap/encodingstyle/literalHandler.rb
+++ b/lib/soap/encodingstyle/literalHandler.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - XML Literal EncodingStyle handler library
-Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# SOAP4R - XML Literal EncodingStyle handler library
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'soap/encodingstyle/handler'
diff --git a/lib/soap/encodingstyle/soapHandler.rb b/lib/soap/encodingstyle/soapHandler.rb
index 0c68810cce..51780f5520 100644
--- a/lib/soap/encodingstyle/soapHandler.rb
+++ b/lib/soap/encodingstyle/soapHandler.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - SOAP EncodingStyle handler library
-Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
+# SOAP4R - SOAP EncodingStyle handler library
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'soap/encodingstyle/handler'
@@ -172,10 +161,9 @@ class SOAPHandler < Handler
elsif href
o = SOAPReference.decode(elename, href)
@refpool << o
- elsif @decode_typemap &&
- (parent.node.class != SOAPBody || @is_first_top_ele)
- # multi-ref element should be parsed by decode_tag_by_type.
- @is_first_top_ele = false
+ elsif @decode_typemap
+ # to parse multi-ref element with decode_tag_by_type.
+ # && (parent.node.class != SOAPBody || @is_first_top_ele)
o = decode_tag_by_wsdl(ns, elename, type, parent.node, arytype, extraattr)
else
o = decode_tag_by_type(ns, elename, type, parent.node, arytype, extraattr)
@@ -344,15 +332,30 @@ private
end
def decode_tag_by_wsdl(ns, elename, typestr, parent, arytypestr, extraattr)
+ o = nil
if parent.class == SOAPBody
- # Unqualified name is allowed here.
- type = @decode_typemap[elename] || @decode_typemap.find_name(elename.name)
- unless type
- raise EncodingStyleError.new("Unknown operation '#{ elename }'.")
+ if @is_first_top_ele
+ # Unqualified name is allowed here.
+ @is_first_top_ele = false
+ type = @decode_typemap[elename] ||
+ @decode_typemap.find_name(elename.name)
+ unless type
+ raise EncodingStyleError.new("Unknown operation '#{ elename }'.")
+ end
+ o = SOAPStruct.new(elename)
+ o.definedtype = type
+ return o
+ elsif !typestr
+ # typeless multi-ref element.
+ return decode_tag_by_type(ns, elename, typestr, parent, arytypestr,
+ extraattr)
+ else
+ # typed multi-ref element.
+ typename = ns.parse(typestr)
+ typedef = @decode_typemap[typename]
+ return decode_defined_compoundtype(elename, typename, typedef,
+ arytypestr)
end
- o = SOAPStruct.new(elename)
- o.definedtype = type
- return o
end
if parent.type == XSD::AnyTypeName
@@ -366,41 +369,41 @@ private
unless parenttype
raise EncodingStyleError.new("Unknown type '#{ parent.type }'.")
end
- typename = parenttype.child_type(elename)
- if typename
- if (klass = TypeMap[typename])
- return klass.decode(elename)
- elsif typename == XSD::AnyTypeName
- return decode_tag_by_type(ns, elename, typestr, parent, arytypestr,
- extraattr)
- end
+
+ definedtype_name = parenttype.child_type(elename)
+ if definedtype_name and (klass = TypeMap[definedtype_name])
+ return klass.decode(elename)
+ elsif definedtype_name == XSD::AnyTypeName
+ return decode_tag_by_type(ns, elename, typestr, parent, arytypestr,
+ extraattr)
end
- type = if typename
- @decode_typemap[typename]
- else
- parenttype.child_defined_complextype(elename)
- end
- unless type
+ typedef = definedtype_name ? @decode_typemap[definedtype_name] :
+ parenttype.child_defined_complextype(elename)
+ decode_defined_compoundtype(elename, definedtype_name, typedef, arytypestr)
+ end
+
+ def decode_defined_compoundtype(elename, typename, typedef, arytypestr)
+ unless typedef
raise EncodingStyleError.new("Unknown type '#{ typename }'.")
end
-
- case type.compoundtype
+ case typedef.compoundtype
when :TYPE_STRUCT
o = SOAPStruct.decode(elename, typename)
- o.definedtype = type
+ o.definedtype = typedef
return o
when :TYPE_ARRAY
- expected_arytype = type.find_arytype
- actual_arytype = if arytypestr
- XSD::QName.new(expected_arytype.namespace,
- content_typename(expected_arytype.name) <<
- content_ranksize(arytypestr))
- else
- expected_arytype
- end
- o = SOAPArray.decode(elename, typename, actual_arytype)
- o.definedtype = type
+ expected_arytype = typedef.find_arytype
+ if arytypestr
+ actual_arytype = XSD::QName.new(expected_arytype.namespace,
+ content_typename(expected_arytype.name) <<
+ content_ranksize(arytypestr))
+ o = SOAPArray.decode(elename, typename, actual_arytype)
+ else
+ o = SOAPArray.new(typename, 1, expected_arytype)
+ o.elename = elename
+ end
+ o.definedtype = typedef
return o
end
return nil
diff --git a/lib/soap/generator.rb b/lib/soap/generator.rb
index 7ddb105f7d..dd868fb9db 100644
--- a/lib/soap/generator.rb
+++ b/lib/soap/generator.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - SOAP XML Instance Generator library.
-Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# SOAP4R - SOAP XML Instance Generator library.
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/ns'
diff --git a/lib/soap/mapping.rb b/lib/soap/mapping.rb
index 8da1978a4f..b83f8b484a 100644
--- a/lib/soap/mapping.rb
+++ b/lib/soap/mapping.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - Ruby type mapping utility.
-Copyright (C) 2003 NAKAMURA, Hiroshi.
+# SOAP4R - Ruby type mapping utility.
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'soap/mapping/mapping'
diff --git a/lib/soap/mapping/factory.rb b/lib/soap/mapping/factory.rb
index 631c161134..509fe369c4 100644
--- a/lib/soap/mapping/factory.rb
+++ b/lib/soap/mapping/factory.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - Mapping factory.
-Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
+# SOAP4R - Mapping factory.
+# Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
module SOAP
@@ -73,11 +62,11 @@ class Factory
def setiv2obj(obj, node, map)
return if node.nil?
- vars = {}
- node.each do |name, value|
- vars[Mapping.elename2name(name)] = Mapping._soap2obj(value, map)
+ if obj.is_a?(Array)
+ setiv2ary(obj, node, map)
+ else
+ setiv2struct(obj, node, map)
end
- Mapping.set_instance_vars(obj, vars)
end
def setiv2soap(node, obj, map)
@@ -105,6 +94,22 @@ class Factory
def capitalize(target)
target.gsub(/^([a-z])/) { $1.tr!('[a-z]', '[A-Z]') }
end
+
+private
+
+ def setiv2ary(obj, node, map)
+ node.each do |name, value|
+ Array.instance_method(:<<).bind(obj).call(Mapping._soap2obj(value, map))
+ end
+ end
+
+ def setiv2struct(obj, node, map)
+ vars = {}
+ node.each do |name, value|
+ vars[Mapping.elename2name(name)] = Mapping._soap2obj(value, map)
+ end
+ Mapping.set_instance_vars(obj, vars)
+ end
end
class StringFactory_ < Factory
diff --git a/lib/soap/mapping/mapping.rb b/lib/soap/mapping/mapping.rb
index f660c2c63f..32be9839c8 100644
--- a/lib/soap/mapping/mapping.rb
+++ b/lib/soap/mapping/mapping.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - Ruby type mapping utility.
-Copyright (C) 2000, 2001, 2003 NAKAMURA Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# SOAP4R - Ruby type mapping utility.
+# Copyright (C) 2000, 2001, 2003 NAKAMURA Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
module SOAP
diff --git a/lib/soap/mapping/registry.rb b/lib/soap/mapping/registry.rb
index e98c98a6d4..51ad939d99 100644
--- a/lib/soap/mapping/registry.rb
+++ b/lib/soap/mapping/registry.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - Mapping registry.
-Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
+# SOAP4R - Mapping registry.
+# Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'soap/baseData'
@@ -145,7 +134,7 @@ class Registry
@registry = registry
end
- def obj2soap(klass, obj)
+ def obj2soap(klass, obj, type_qname = nil)
@map.each do |obj_class, soap_class, factory, info|
if klass == obj_class or
(info[:derived_class] and klass <= obj_class)
@@ -330,8 +319,8 @@ class Registry
alias :set :add
# This mapping registry ignores type hint.
- def obj2soap(klass, obj, type = nil)
- soap = _obj2soap(klass, obj, type)
+ def obj2soap(klass, obj, type_qname = nil)
+ soap = _obj2soap(klass, obj, type_qname)
if @allow_original_mapping
addextend2soap(soap, obj)
end
@@ -369,7 +358,7 @@ class Registry
private
- def _obj2soap(klass, obj, type)
+ def _obj2soap(klass, obj, type_qname)
ret = nil
if obj.is_a?(SOAPStruct) or obj.is_a?(SOAPArray)
obj.replace do |ele|
@@ -380,7 +369,7 @@ private
return obj
end
begin
- ret = @map.obj2soap(klass, obj) ||
+ ret = @map.obj2soap(klass, obj, type_qname) ||
@default_factory.obj2soap(klass, obj, nil, self)
rescue MappingError
end
diff --git a/lib/soap/mapping/rubytypeFactory.rb b/lib/soap/mapping/rubytypeFactory.rb
index 3ebb799220..0b4af8b8e4 100644
--- a/lib/soap/mapping/rubytypeFactory.rb
+++ b/lib/soap/mapping/rubytypeFactory.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - Ruby type mapping factory.
-Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
+# SOAP4R - Ruby type mapping factory.
+# Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
module SOAP
diff --git a/lib/soap/mapping/typeMap.rb b/lib/soap/mapping/typeMap.rb
index c62f1482c1..93f24b4bd8 100644
--- a/lib/soap/mapping/typeMap.rb
+++ b/lib/soap/mapping/typeMap.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - Base type mapping definition
-Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# SOAP4R - Base type mapping definition
+# Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
module SOAP
diff --git a/lib/soap/mapping/wsdlRegistry.rb b/lib/soap/mapping/wsdlRegistry.rb
index 4b5beabe72..66d16c6f90 100644
--- a/lib/soap/mapping/wsdlRegistry.rb
+++ b/lib/soap/mapping/wsdlRegistry.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - WSDL mapping registry.
-Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# SOAP4R - WSDL mapping registry.
+# Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'soap/baseData'
diff --git a/lib/soap/marshal.rb b/lib/soap/marshal.rb
index 5c25fad0de..910ab24527 100644
--- a/lib/soap/marshal.rb
+++ b/lib/soap/marshal.rb
@@ -1,25 +1,9 @@
-=begin
-SOAP4R - Marshalling/Unmarshalling Ruby's object using SOAP Encoding.
-Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
+# SOAP4R - Marshalling/Unmarshalling Ruby's object using SOAP Encoding.
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
-
-
-# The original version of the marshal.rb to marshal/unmarshal Ruby's object
-# using SOAP Encoding was written by Michael Neumann. His valuable comments
-# and his program inspired me to write this. Thanks.
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require "soap/mapping"
@@ -58,7 +42,9 @@ module Marshal
def unmarshal(stream, mapping_registry = MarshalMappingRegistry)
header, body = SOAP::Processor.unmarshal(stream)
- #Mapping.soap2obj(body.root_node, mapping_registry)
+ if body.nil?
+ raise ArgumentError.new("Illegal SOAP marshal format.")
+ end
Mapping.soap2obj(body.root_node, mapping_registry)
end
end
diff --git a/lib/soap/netHttpClient.rb b/lib/soap/netHttpClient.rb
index facdcb7279..04d1937133 100644
--- a/lib/soap/netHttpClient.rb
+++ b/lib/soap/netHttpClient.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - net/http wrapper
-Copyright (C) 2003 NAKAMURA, Hiroshi.
+# SOAP4R - net/http wrapper
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'net/http'
@@ -25,6 +14,13 @@ module SOAP
class NetHttpClient
+ SSLEnabled = begin
+ require 'net/https'
+ true
+ rescue LoadError
+ false
+ end
+
attr_accessor :proxy
attr_accessor :no_proxy
attr_accessor :debug_dev
@@ -86,20 +82,39 @@ class NetHttpClient
private
def start(url)
+ http = create_connection(url)
+ response = nil
+ http.start { |worker|
+ response, = yield(worker)
+ worker.finish
+ }
+ @debug_dev << response.body if @debug_dev
+ response
+ end
+
+ def create_connection(url)
proxy_host = proxy_port = nil
unless no_proxy?(url)
proxy_host = @proxy.host
proxy_port = @proxy.port
end
- response = nil
- Net::HTTP::Proxy(proxy_host, proxy_port).start(url.host, url.port) { |http|
- if http.respond_to?(:set_debug_output)
- http.set_debug_output(@debug_dev)
+ http = Net::HTTP::Proxy(proxy_host, proxy_port).new(url.host, url.port)
+ if http.respond_to?(:set_debug_output)
+ http.set_debug_output(@debug_dev)
+ end
+ case url
+ when URI::HTTPS
+ if SSLEnabled
+ http.use_ssl = true
+ else
+ raise RuntimeError.new("Cannot connect to #{url} (OpenSSL is not installed.)")
end
- response, = yield(http)
- http.finish
- }
- response
+ when URI::HTTP
+ # OK
+ else
+ raise RuntimeError.new("Cannot connect to #{url} (Not HTTP.)")
+ end
+ http
end
NO_PROXY_HOSTS = ['localhost']
diff --git a/lib/soap/parser.rb b/lib/soap/parser.rb
index 67782566c3..1395be55ec 100644
--- a/lib/soap/parser.rb
+++ b/lib/soap/parser.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - SOAP XML Instance Parser library.
-Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# SOAP4R - SOAP XML Instance Parser library.
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/ns'
diff --git a/lib/soap/processor.rb b/lib/soap/processor.rb
index 47df772a9d..9cf00e8340 100644
--- a/lib/soap/processor.rb
+++ b/lib/soap/processor.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - marshal/unmarshal interface.
-Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# SOAP4R - marshal/unmarshal interface.
+# Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/datatypes'
diff --git a/lib/soap/rpc/cgistub.rb b/lib/soap/rpc/cgistub.rb
index e89314d132..2377f343b5 100644
--- a/lib/soap/rpc/cgistub.rb
+++ b/lib/soap/rpc/cgistub.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - CGI stub library
-Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# SOAP4R - CGI stub library
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'soap/streamHandler'
diff --git a/lib/soap/rpc/driver.rb b/lib/soap/rpc/driver.rb
index 76fd14e34b..739c8774d4 100644
--- a/lib/soap/rpc/driver.rb
+++ b/lib/soap/rpc/driver.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - SOAP RPC driver
-Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi.
+# SOAP4R - SOAP RPC driver
+# Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'soap/soap'
@@ -35,51 +24,63 @@ public
attr_accessor :mapping_registry
attr_accessor :soapaction
- attr_reader :endpoint_url
attr_reader :wiredump_dev
attr_reader :wiredump_file_base
- attr_reader :httpproxy
+ attr_reader :streamhandler
def initialize(endpoint_url, namespace, soapaction = nil)
- @endpoint_url = endpoint_url
@namespace = namespace
@mapping_registry = nil # for unmarshal
@soapaction = soapaction
@wiredump_dev = nil
@wiredump_file_base = nil
- @httpproxy = ENV['httpproxy'] || ENV['HTTP_PROXY']
- @handler = HTTPPostStreamHandler.new(@endpoint_url, @httpproxy,
+ name = 'http_proxy'
+ @httpproxy = ENV[name] || ENV[name.upcase]
+ @streamhandler = HTTPPostStreamHandler.new(endpoint_url, @httpproxy,
XSD::Charset.encoding_label)
- @proxy = Proxy.new(@handler, @soapaction)
+ @proxy = Proxy.new(@streamhandler, @soapaction)
@proxy.allow_unqualified_element = true
end
+ def inspect
+ "#<#{self.class}:#{@streamhandler.inspect}>"
+ end
+
+ def endpoint_url
+ @streamhandler.endpoint_url
+ end
+
def endpoint_url=(endpoint_url)
- @endpoint_url = endpoint_url
- if @handler
- @handler.endpoint_url = @endpoint_url
- @handler.reset
- end
+ @streamhandler.endpoint_url = endpoint_url
+ @streamhandler.reset
end
def wiredump_dev=(dev)
@wiredump_dev = dev
- if @handler
- @handler.wiredump_dev = @wiredump_dev
- @handler.reset
- end
+ @streamhandler.wiredump_dev = @wiredump_dev
+ @streamhandler.reset
end
def wiredump_file_base=(base)
@wiredump_file_base = base
end
+ def httpproxy
+ @httpproxy
+ end
+
def httpproxy=(httpproxy)
@httpproxy = httpproxy
- if @handler
- @handler.proxy = @httpproxy
- @handler.reset
- end
+ @streamhandler.proxy = @httpproxy
+ @streamhandler.reset
+ end
+
+ def mandatorycharset
+ @proxy.mandatorycharset
+ end
+
+ def mandatorycharset=(mandatorycharset)
+ @proxy.mandatorycharset = mandatorycharset
end
def default_encodingstyle
@@ -126,7 +127,7 @@ public
#
def invoke(headers, body)
if @wiredump_file_base
- @handler.wiredump_file_base =
+ @streamhandler.wiredump_file_base =
@wiredump_file_base + '_' << body.elename.name
end
@proxy.invoke(headers, body)
@@ -136,7 +137,7 @@ public
# Convert parameters: params array => SOAPArray => members array
params = Mapping.obj2soap(params, @mapping_registry).to_a
if @wiredump_file_base
- @handler.wiredump_file_base = @wiredump_file_base + '_' << name
+ @streamhandler.wiredump_file_base = @wiredump_file_base + '_' << name
end
# Then, call @proxy.call like the following.
@@ -161,7 +162,7 @@ public
end
def reset_stream
- @handler.reset
+ @streamhandler.reset
end
private
diff --git a/lib/soap/rpc/element.rb b/lib/soap/rpc/element.rb
index d1e1931fa3..395823ab00 100644
--- a/lib/soap/rpc/element.rb
+++ b/lib/soap/rpc/element.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - RPC element definition.
-Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi.
+# SOAP4R - RPC element definition.
+# Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'soap/baseData'
@@ -180,10 +169,10 @@ class SOAPMethodRequest < SOAPMethod
params.each do |param|
param_name = "p#{ i }"
i += 1
- param_def << [IN, nil, param_name]
+ param_def << [IN, param_name, nil]
param_value << [param_name, param]
end
- param_def << [RETVAL, nil, 'return']
+ param_def << [RETVAL, 'return', nil]
o = new(qname, param_def)
o.set_param(param_value)
o
@@ -236,7 +225,7 @@ class SOAPMethodResponse < SOAPMethod
def retval=(retval)
@retval = retval
- @retval.elename = @retval.elename.dup_name('return')
+ @retval.elename = @retval.elename.dup_name(@retval_name || 'return')
end
def each
diff --git a/lib/soap/rpc/proxy.rb b/lib/soap/rpc/proxy.rb
index 39a095838c..5825a27138 100644
--- a/lib/soap/rpc/proxy.rb
+++ b/lib/soap/rpc/proxy.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - RPC Proxy library.
-Copyright (C) 2000, 2003 NAKAMURA, Hiroshi.
+# SOAP4R - RPC Proxy library.
+# Copyright (C) 2000, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'soap/soap'
@@ -35,13 +24,16 @@ class Proxy
public
attr_accessor :soapaction
- attr_accessor :allow_unqualified_element, :default_encodingstyle
+ attr_accessor :mandatorycharset
+ attr_accessor :allow_unqualified_element
+ attr_accessor :default_encodingstyle
attr_reader :method
- def initialize(stream_handler, soapaction = nil)
- @handler = stream_handler
+ def initialize(streamhandler, soapaction = nil)
+ @streamhandler = streamhandler
@soapaction = soapaction
@method = {}
+ @mandatorycharset = nil
@allow_unqualified_element = false
@default_encodingstyle = nil
end
@@ -100,13 +92,13 @@ public
end
opt = create_options
send_string = Processor.marshal(req_header, req_body, opt)
- data = @handler.send(send_string, soapaction)
+ data = @streamhandler.send(send_string, soapaction)
if data.receive_string.empty?
return nil, nil
end
- res_charset = StreamHandler.parse_media_type(data.receive_contenttype)
opt = create_options
- opt[:charset] = res_charset
+ opt[:charset] = @mandatorycharset ||
+ StreamHandler.parse_media_type(data.receive_contenttype)
res_header, res_body = Processor.unmarshal(data.receive_string, opt)
return res_header, res_body
end
diff --git a/lib/soap/rpc/router.rb b/lib/soap/rpc/router.rb
index 20396a4a7d..527ec05768 100644
--- a/lib/soap/rpc/router.rb
+++ b/lib/soap/rpc/router.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - RPC Routing library
-Copyright (C) 2001, 2002 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# SOAP4R - RPC Routing library
+# Copyright (C) 2001, 2002 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'soap/soap'
diff --git a/lib/soap/rpc/rpc.rb b/lib/soap/rpc/rpc.rb
index c3cb3228f5..5f77b4d2e9 100644
--- a/lib/soap/rpc/rpc.rb
+++ b/lib/soap/rpc/rpc.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - RPC utility.
-Copyright (C) 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# SOAP4R - RPC utility.
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
module SOAP
diff --git a/lib/soap/rpc/soaplet.rb b/lib/soap/rpc/soaplet.rb
index 1a4ef99b76..4b25c68161 100644
--- a/lib/soap/rpc/soaplet.rb
+++ b/lib/soap/rpc/soaplet.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - SOAP handler servlet for WEBrick
-Copyright (C) 2001, 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# SOAP4R - SOAP handler servlet for WEBrick
+# Copyright (C) 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'webrick/httpservlet/abstract'
diff --git a/lib/soap/rpc/standaloneServer.rb b/lib/soap/rpc/standaloneServer.rb
index 8862f7606e..f3f225c7dc 100644
--- a/lib/soap/rpc/standaloneServer.rb
+++ b/lib/soap/rpc/standaloneServer.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - WEBrick Server
-Copyright (C) 2003 by NAKAMURA, Hiroshi
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# SOAP4R - WEBrick Server
+# Copyright (C) 2003 by NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'logger'
diff --git a/lib/soap/soap.rb b/lib/soap/soap.rb
index 2543ec3612..fcfbb2ef2b 100644
--- a/lib/soap/soap.rb
+++ b/lib/soap/soap.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - Base definitions.
-Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# soap/soap.rb: SOAP4R - Base definitions.
+# Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/qname'
diff --git a/lib/soap/streamHandler.rb b/lib/soap/streamHandler.rb
index a9068b368d..7dcb2d62d6 100644
--- a/lib/soap/streamHandler.rb
+++ b/lib/soap/streamHandler.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - Stream handler.
-Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi.
+# SOAP4R - Stream handler.
+# Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'soap/soap'
@@ -73,7 +62,7 @@ class StreamHandler
end
charset = $1
charset.gsub!(/"/, '') if charset
- charset
+ charset || 'us-ascii'
end
def self.create_media_type(charset)
@@ -90,6 +79,7 @@ public
attr_accessor :wiredump_dev
attr_accessor :wiredump_file_base
attr_accessor :charset
+ attr_reader :client
NofRetry = 10 # [times]
ConnectTimeout = 20 # [sec]
@@ -108,6 +98,10 @@ public
@client.session_manager.receive_timeout = ReceiveTimeout
end
+ def inspect
+ "#<#{self.class}:#{endpoint_url}>"
+ end
+
def proxy=(proxy)
@proxy = proxy
@client.proxy = @proxy
diff --git a/lib/soap/wsdlDriver.rb b/lib/soap/wsdlDriver.rb
index 6ecc4b4f6e..d629aa12ce 100644
--- a/lib/soap/wsdlDriver.rb
+++ b/lib/soap/wsdlDriver.rb
@@ -1,20 +1,9 @@
-=begin
-SOAP4R - SOAP WSDL driver
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# SOAP4R - SOAP WSDL driver
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/parser'
@@ -43,6 +32,10 @@ class WSDLDriverFactory
@logdev = logdev
@wsdl = import(wsdl)
end
+
+ def inspect
+ "#<#{self.class}:#{@wsdl.name}>"
+ end
def create_driver(servicename = nil, portname = nil, opt = {})
service = if servicename
@@ -105,6 +98,7 @@ class WSDLDriver
__attr_proxy :wiredump_dev, true
__attr_proxy :wiredump_file_base, true
__attr_proxy :httpproxy, true
+ __attr_proxy :mandatorycharset, true # force using charset
__attr_proxy :default_encodingstyle, true
__attr_proxy :allow_unqualified_element, true
@@ -121,14 +115,16 @@ class WSDLDriver
include Logger::Severity
include SOAP
+ attr_reader :wsdl
+ attr_reader :port
attr_reader :opt
attr_accessor :logdev
attr_accessor :mapping_registry
attr_accessor :wsdl_mapping_registry
- attr_reader :endpoint_url
attr_reader :wiredump_dev
attr_reader :wiredump_file_base
attr_reader :httpproxy
+ attr_accessor :mandatorycharset
attr_accessor :default_encodingstyle
attr_accessor :allow_unqualified_element
@@ -220,11 +216,9 @@ class WSDLDriver
@opt = opt.dup
@mapping_registry = nil # for rpc unmarshal
@wsdl_mapping_registry = nil # for rpc marshal
- @endpoint_url = nil
@wiredump_dev = nil
@wiredump_file_base = nil
- name = 'http_proxy'
- @httpproxy = ENV[name] || ENV[name.upcase]
+ @mandatorycharset = nil
@wsdl_elements = @wsdl.collect_elements
@wsdl_types = @wsdl.collect_complextypes
@@ -235,7 +229,8 @@ class WSDLDriver
@allow_unqualified_element = true
@generate_explicit_type = false
- create_handler
+ create_streamhandler(@port.soap_address.location,
+ ENV['http_proxy'] || ENV['HTTP_PROXY'])
@operations = {}
# Convert a map which key is QName, to a Hash which key is String.
@port.inputoperation_map.each do |op_name, op_info|
@@ -244,21 +239,20 @@ class WSDLDriver
end
end
+ def endpoint_url
+ @streamhandler.endpoint_url
+ end
+
def endpoint_url=(endpoint_url)
- @endpoint_url = endpoint_url
- if @handler
- @handler.endpoint_url = @endpoint_url
- @handler.reset
- end
- log(DEBUG) { "endpoint_url=: set endpoint_url #{ @endpoint_url }." }
+ @streamhandler.endpoint_url = endpoint_url
+ @streamhandler.reset
+ log(DEBUG) { "endpoint_url=: set endpoint_url #{ endpoint_url }." }
end
def wiredump_dev=(dev)
@wiredump_dev = dev
- if @handler
- @handler.wiredump_dev = @wiredump_dev
- @handler.reset
- end
+ @streamhandler.wiredump_dev = @wiredump_dev
+ @streamhandler.reset
end
def wiredump_file_base=(base)
@@ -266,16 +260,13 @@ class WSDLDriver
end
def httpproxy=(httpproxy)
- @httpproxy = httpproxy
- if @handler
- @handler.proxy = @httpproxy
- @handler.reset
- end
- log(DEBUG) { "httpproxy=: set httpproxy #{ @httpproxy }." }
+ @streamhandler.proxy = httpproxy
+ @streamhandler.reset
+ log(DEBUG) { "httpproxy=: set httpproxy #{ httpproxy }." }
end
def reset_stream
- @handler.reset
+ @streamhandler.reset
end
def rpc_send(method_name, *params)
@@ -292,7 +283,8 @@ class WSDLDriver
req_body = SOAPBody.new(method)
if @wiredump_file_base
- @handler.wiredump_file_base = @wiredump_file_base + '_' << method_name
+ @streamhandler.wiredump_file_base =
+ @wiredump_file_base + '_' << method_name
end
begin
@@ -338,11 +330,10 @@ class WSDLDriver
private
- def create_handler
- endpoint_url = @endpoint_url || @port.soap_address.location
- @handler = HTTPPostStreamHandler.new(endpoint_url, @httpproxy,
+ def create_streamhandler(endpoint_url, httpproxy)
+ @streamhandler = HTTPPostStreamHandler.new(endpoint_url, httpproxy,
XSD::Charset.encoding_label)
- @handler.wiredump_dev = @wiredump_dev
+ @streamhandler.wiredump_dev = @wiredump_dev
end
def create_method_obj(names, params)
@@ -356,13 +347,13 @@ class WSDLDriver
def invoke(req_header, req_body, op_info, opt)
send_string = Processor.marshal(req_header, req_body, opt)
log(DEBUG) { "invoke: sending string #{ send_string }" }
- data = @handler.send(send_string, op_info.soapaction)
+ data = @streamhandler.send(send_string, op_info.soapaction)
log(DEBUG) { "invoke: received string #{ data.receive_string }" }
if data.receive_string.empty?
return nil, nil
end
- res_charset = StreamHandler.parse_media_type(data.receive_contenttype)
- opt[:charset] = res_charset
+ opt[:charset] = @mandatorycharset ||
+ StreamHandler.parse_media_type(data.receive_contenttype)
res_header, res_body = Processor.unmarshal(data.receive_string, opt)
return res_header, res_body
end
@@ -483,6 +474,10 @@ class WSDLDriver
def initialize(wsdl, port, logdev, opt)
@servant = Servant__.new(self, wsdl, port, logdev, opt)
end
+
+ def inspect
+ "#<#{self.class}:#{@servant.port.name}>"
+ end
end
diff --git a/lib/wsdl/binding.rb b/lib/wsdl/binding.rb
index 349d6edcb6..e8c9d5be9d 100644
--- a/lib/wsdl/binding.rb
+++ b/lib/wsdl/binding.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL binding definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - WSDL binding definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/data.rb b/lib/wsdl/data.rb
index 3361dac1f4..8a14dd14d7 100644
--- a/lib/wsdl/data.rb
+++ b/lib/wsdl/data.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL data definitions.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - WSDL data definitions.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/documentation'
diff --git a/lib/wsdl/definitions.rb b/lib/wsdl/definitions.rb
index 7a0cff01e7..561a335744 100644
--- a/lib/wsdl/definitions.rb
+++ b/lib/wsdl/definitions.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL definitions.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - WSDL definitions.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
@@ -53,6 +42,11 @@ class Definitions < Info
@root = self
end
+ def inspect
+ name = @name || '(unnamed)'
+ "#<#{self.class}:#{name}>"
+ end
+
def targetnamespace=(targetnamespace)
@targetnamespace = targetnamespace
if @name
diff --git a/lib/wsdl/documentation.rb b/lib/wsdl/documentation.rb
index 00e78a99df..3a7fd7d23e 100644
--- a/lib/wsdl/documentation.rb
+++ b/lib/wsdl/documentation.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL SOAP documentation element.
-Copyright (C) 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - WSDL SOAP documentation element.
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/import.rb b/lib/wsdl/import.rb
index a0fa26afaf..ab244f6ca6 100644
--- a/lib/wsdl/import.rb
+++ b/lib/wsdl/import.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL import definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - WSDL import definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/importer.rb b/lib/wsdl/importer.rb
index 794e7fc74d..d35ed5d698 100644
--- a/lib/wsdl/importer.rb
+++ b/lib/wsdl/importer.rb
@@ -1,23 +1,13 @@
-=begin
-WSDL4R - WSDL importer library.
-Copyright (C) 2003 NAKAMURA, Hiroshi.
+# WSDL4R - WSDL importer library.
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
+require 'wsdl/parser'
module WSDL
diff --git a/lib/wsdl/info.rb b/lib/wsdl/info.rb
index 886b9255ae..657ff5863a 100644
--- a/lib/wsdl/info.rb
+++ b/lib/wsdl/info.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL information base.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - WSDL information base.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
module WSDL
diff --git a/lib/wsdl/message.rb b/lib/wsdl/message.rb
index 68f3bb89dd..a346708cf4 100644
--- a/lib/wsdl/message.rb
+++ b/lib/wsdl/message.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL message definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - WSDL message definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/operation.rb b/lib/wsdl/operation.rb
index ff3450d234..be28446d34 100644
--- a/lib/wsdl/operation.rb
+++ b/lib/wsdl/operation.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL operation definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - WSDL operation definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
@@ -49,7 +38,7 @@ class Operation < Info
@parameter_order = nil
@input = nil
@output = nil
- @fault = nil
+ @fault = []
end
def targetnamespace
@@ -76,10 +65,6 @@ class Operation < Info
sort_parts(output.find_message.parts)
end
- def faultparts
- sort_parts(fault.find_message.parts)
- end
-
def outputname
XSD::QName.new(targetnamespace,
output.name ? output.name.name : @name.name + 'Response')
@@ -97,7 +82,7 @@ class Operation < Info
o
when FaultName
o = Param.new
- @fault = o
+ @fault << o
o
when DocumentationName
o = Documentation.new
diff --git a/lib/wsdl/operationBinding.rb b/lib/wsdl/operationBinding.rb
index 0bd0d9b105..4c04a884ea 100644
--- a/lib/wsdl/operationBinding.rb
+++ b/lib/wsdl/operationBinding.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL bound operation definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - WSDL bound operation definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
@@ -35,7 +24,7 @@ class OperationBinding < Info
@name = nil
@input = nil
@output = nil
- @fault = nil
+ @fault = []
@soapoperation = nil
end
@@ -63,7 +52,7 @@ class OperationBinding < Info
o
when FaultName
o = Param.new
- @fault = o
+ @fault << o
o
when SOAPOperationName
o = WSDL::SOAP::Operation.new
diff --git a/lib/wsdl/param.rb b/lib/wsdl/param.rb
index 10111677d2..06dd3beb7e 100644
--- a/lib/wsdl/param.rb
+++ b/lib/wsdl/param.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL param definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - WSDL param definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/parser.rb b/lib/wsdl/parser.rb
index e0a8945bb0..7e7a4d8bce 100644
--- a/lib/wsdl/parser.rb
+++ b/lib/wsdl/parser.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL XML Instance parser library.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - WSDL XML Instance parser library.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/qname'
diff --git a/lib/wsdl/part.rb b/lib/wsdl/part.rb
index 2aeb457c4e..30f71f15d9 100644
--- a/lib/wsdl/part.rb
+++ b/lib/wsdl/part.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL part definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - WSDL part definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/port.rb b/lib/wsdl/port.rb
index b389f6ca02..e6553f1287 100644
--- a/lib/wsdl/port.rb
+++ b/lib/wsdl/port.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL port definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - WSDL port definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/portType.rb b/lib/wsdl/portType.rb
index b3a99b3bc0..e3cf9b51ec 100644
--- a/lib/wsdl/portType.rb
+++ b/lib/wsdl/portType.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL portType definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - WSDL portType definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/service.rb b/lib/wsdl/service.rb
index efaeaa727a..0e0843a098 100644
--- a/lib/wsdl/service.rb
+++ b/lib/wsdl/service.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL service definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - WSDL service definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/soap/address.rb b/lib/wsdl/soap/address.rb
index 759918c95b..e4558e4ff8 100644
--- a/lib/wsdl/soap/address.rb
+++ b/lib/wsdl/soap/address.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL SOAP address definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - WSDL SOAP address definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/soap/binding.rb b/lib/wsdl/soap/binding.rb
index e9ba3a48d1..1cfe9b9cc4 100644
--- a/lib/wsdl/soap/binding.rb
+++ b/lib/wsdl/soap/binding.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL SOAP binding definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - WSDL SOAP binding definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/soap/body.rb b/lib/wsdl/soap/body.rb
index f209622410..47de6b1e1a 100644
--- a/lib/wsdl/soap/body.rb
+++ b/lib/wsdl/soap/body.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL SOAP body definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - WSDL SOAP body definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/soap/complexType.rb b/lib/wsdl/soap/complexType.rb
index f47ddee449..e9818faa9a 100644
--- a/lib/wsdl/soap/complexType.rb
+++ b/lib/wsdl/soap/complexType.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - SOAP complexType definition for WSDL.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - SOAP complexType definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/xmlSchema/complexType'
@@ -31,7 +20,11 @@ class ComplexType < Info
def check_type
if content
- :TYPE_STRUCT
+ if content.elements.size == 1 and content.elements[0].maxoccurs != 1
+ :TYPE_ARRAY
+ else
+ :TYPE_STRUCT
+ end
elsif complexcontent and complexcontent.base == ::SOAP::ValueArrayName
:TYPE_ARRAY
else
@@ -70,10 +63,19 @@ class ComplexType < Info
end
def find_arytype
- complexcontent.attributes.each do |attribute|
- if attribute.ref == ::SOAP::AttrArrayTypeName
- return attribute.arytype
+ unless compoundtype == :TYPE_ARRAY
+ raise RuntimeError.new("Assert: not for array")
+ end
+ if complexcontent
+ complexcontent.attributes.each do |attribute|
+ if attribute.ref == ::SOAP::AttrArrayTypeName
+ return attribute.arytype
+ end
end
+ elsif content.elements.size == 1 and content.elements[0].maxoccurs != 1
+ return content.elements[0].type
+ else
+ raise RuntimeError.new("Assert: Unknown array definition.")
end
nil
end
@@ -81,9 +83,6 @@ class ComplexType < Info
private
def content_arytype
- unless compoundtype == :TYPE_ARRAY
- raise RuntimeError.new("Assert: not for array")
- end
arytype = find_arytype
ns = arytype.namespace
name = arytype.name.sub(/\[(?:,)*\]$/, '')
diff --git a/lib/wsdl/soap/data.rb b/lib/wsdl/soap/data.rb
index 301ae9951d..23aaff83b5 100644
--- a/lib/wsdl/soap/data.rb
+++ b/lib/wsdl/soap/data.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL SOAP binding data definitions.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - WSDL SOAP binding data definitions.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/qname'
diff --git a/lib/wsdl/soap/definitions.rb b/lib/wsdl/soap/definitions.rb
index 1bd8e8a664..1a152ee693 100644
--- a/lib/wsdl/soap/definitions.rb
+++ b/lib/wsdl/soap/definitions.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL additional definitions for SOAP.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
+# WSDL4R - WSDL additional definitions for SOAP.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/soap/fault.rb b/lib/wsdl/soap/fault.rb
index eb57cb0233..abd3cbe3dd 100644
--- a/lib/wsdl/soap/fault.rb
+++ b/lib/wsdl/soap/fault.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL SOAP body definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - WSDL SOAP body definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/soap/header.rb b/lib/wsdl/soap/header.rb
index f779ba5c08..f1dd69eafb 100644
--- a/lib/wsdl/soap/header.rb
+++ b/lib/wsdl/soap/header.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL SOAP body definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - WSDL SOAP body definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/soap/headerfault.rb b/lib/wsdl/soap/headerfault.rb
index c0d58e2230..a6e86661c2 100644
--- a/lib/wsdl/soap/headerfault.rb
+++ b/lib/wsdl/soap/headerfault.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL SOAP body definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - WSDL SOAP body definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/soap/operation.rb b/lib/wsdl/soap/operation.rb
index 2e88522f5c..e50356cf35 100644
--- a/lib/wsdl/soap/operation.rb
+++ b/lib/wsdl/soap/operation.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL SOAP operation definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - WSDL SOAP operation definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/types.rb b/lib/wsdl/types.rb
index 420ab8d387..96ae5a4988 100644
--- a/lib/wsdl/types.rb
+++ b/lib/wsdl/types.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL types definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - WSDL types definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/wsdl.rb b/lib/wsdl/wsdl.rb
index 23fd764065..eb13c18806 100644
--- a/lib/wsdl/wsdl.rb
+++ b/lib/wsdl/wsdl.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - Base definitions.
-Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - Base definitions.
+# Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/qname'
diff --git a/lib/wsdl/xmlSchema/all.rb b/lib/wsdl/xmlSchema/all.rb
index 7db0fbc939..53f7ae82e4 100644
--- a/lib/wsdl/xmlSchema/all.rb
+++ b/lib/wsdl/xmlSchema/all.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - XMLSchema complexType definition for WSDL.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - XMLSchema complexType definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/xmlSchema/any.rb b/lib/wsdl/xmlSchema/any.rb
index 46904c4107..3fc3706182 100644
--- a/lib/wsdl/xmlSchema/any.rb
+++ b/lib/wsdl/xmlSchema/any.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - XMLSchema any definition for WSDL.
-Copyright (C) 2003 NAKAMURA, Hiroshi.
+# WSDL4R - XMLSchema any definition for WSDL.
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/xmlSchema/attribute.rb b/lib/wsdl/xmlSchema/attribute.rb
index 08cc9e931b..e5046dd991 100644
--- a/lib/wsdl/xmlSchema/attribute.rb
+++ b/lib/wsdl/xmlSchema/attribute.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - XMLSchema attribute definition for WSDL.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - XMLSchema attribute definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/xmlSchema/choice.rb b/lib/wsdl/xmlSchema/choice.rb
index f31e93b3f1..4cf481ec9e 100644
--- a/lib/wsdl/xmlSchema/choice.rb
+++ b/lib/wsdl/xmlSchema/choice.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - XMLSchema complexType definition for WSDL.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - XMLSchema complexType definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/xmlSchema/complexContent.rb b/lib/wsdl/xmlSchema/complexContent.rb
index 79c231ac2d..22f6851864 100644
--- a/lib/wsdl/xmlSchema/complexContent.rb
+++ b/lib/wsdl/xmlSchema/complexContent.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - XMLSchema complexContent definition for WSDL.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - XMLSchema complexContent definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/xmlSchema/complexType.rb b/lib/wsdl/xmlSchema/complexType.rb
index c34be3e57b..e889482d09 100644
--- a/lib/wsdl/xmlSchema/complexType.rb
+++ b/lib/wsdl/xmlSchema/complexType.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - XMLSchema complexType definition for WSDL.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - XMLSchema complexType definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/xmlSchema/content.rb b/lib/wsdl/xmlSchema/content.rb
index a1bd302701..3aa875e3e7 100644
--- a/lib/wsdl/xmlSchema/content.rb
+++ b/lib/wsdl/xmlSchema/content.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - XMLSchema complexType definition for WSDL.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - XMLSchema complexType definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/xmlSchema/data.rb b/lib/wsdl/xmlSchema/data.rb
index 57d2f527c0..2fa8ad6a91 100644
--- a/lib/wsdl/xmlSchema/data.rb
+++ b/lib/wsdl/xmlSchema/data.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - XMLSchema data definitions.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - XMLSchema data definitions.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/xmlSchema/schema'
diff --git a/lib/wsdl/xmlSchema/element.rb b/lib/wsdl/xmlSchema/element.rb
index d6d17c08cf..90e8c0d5d1 100644
--- a/lib/wsdl/xmlSchema/element.rb
+++ b/lib/wsdl/xmlSchema/element.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - XMLSchema element definition for WSDL.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - XMLSchema element definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/xmlSchema/import.rb b/lib/wsdl/xmlSchema/import.rb
index 2267125a70..2ef3b72ab2 100644
--- a/lib/wsdl/xmlSchema/import.rb
+++ b/lib/wsdl/xmlSchema/import.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - XMLSchema import definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - XMLSchema import definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/xmlSchema/parser.rb b/lib/wsdl/xmlSchema/parser.rb
index 6e893cdc7e..688af27c8c 100644
--- a/lib/wsdl/xmlSchema/parser.rb
+++ b/lib/wsdl/xmlSchema/parser.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - WSDL XML Instance parser library.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - WSDL XML Instance parser library.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/qname'
diff --git a/lib/wsdl/xmlSchema/schema.rb b/lib/wsdl/xmlSchema/schema.rb
index 3a9aa6842e..1d7759605e 100644
--- a/lib/wsdl/xmlSchema/schema.rb
+++ b/lib/wsdl/xmlSchema/schema.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - XMLSchema schema definition for WSDL.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - XMLSchema schema definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/xmlSchema/sequence.rb b/lib/wsdl/xmlSchema/sequence.rb
index fb5ca1aef6..3810832ab2 100644
--- a/lib/wsdl/xmlSchema/sequence.rb
+++ b/lib/wsdl/xmlSchema/sequence.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - XMLSchema complexType definition for WSDL.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# WSDL4R - XMLSchema complexType definition for WSDL.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/wsdl/xmlSchema/unique.rb b/lib/wsdl/xmlSchema/unique.rb
index 1d2573f6b0..837ff22b4a 100644
--- a/lib/wsdl/xmlSchema/unique.rb
+++ b/lib/wsdl/xmlSchema/unique.rb
@@ -1,20 +1,9 @@
-=begin
-WSDL4R - XMLSchema unique element.
-Copyright (C) 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# WSDL4R - XMLSchema unique element.
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'wsdl/info'
diff --git a/lib/xsd/charset.rb b/lib/xsd/charset.rb
index 3daace7bf3..fc8d48e439 100644
--- a/lib/xsd/charset.rb
+++ b/lib/xsd/charset.rb
@@ -1,20 +1,9 @@
-=begin
-XSD4R - Charset handling library.
-Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
+# XSD4R - Charset handling library.
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
module XSD
@@ -40,15 +29,15 @@ public
@encoding = 'UTF8'
EncodingConvertMap[['UTF8', 'EUC' ]] = Proc.new { |str| IconvCharset.safe_iconv("euc-jp", "utf-8", str) }
EncodingConvertMap[['EUC' , 'UTF8']] = Proc.new { |str| IconvCharset.safe_iconv("utf-8", "euc-jp", str) }
- EncodingConvertMap[['EUC' , 'SJIS']] = Proc.new { |str| IconvCharset.safe_iconv("shift-jis", "euc-jp", str) }
+ EncodingConvertMap[['EUC' , 'SJIS']] = Proc.new { |str| IconvCharset.safe_iconv("shift_jis", "euc-jp", str) }
if /(mswin|bccwin|mingw|cygwin|emx)/ =~ RUBY_PLATFORM
EncodingConvertMap[['UTF8', 'SJIS']] = Proc.new { |str| IconvCharset.safe_iconv("cp932", "utf-8", str) }
EncodingConvertMap[['SJIS', 'UTF8']] = Proc.new { |str| IconvCharset.safe_iconv("utf-8", "cp932", str) }
EncodingConvertMap[['SJIS', 'EUC' ]] = Proc.new { |str| IconvCharset.safe_iconv("euc-jp", "cp932", str) }
else
- EncodingConvertMap[['UTF8', 'SJIS']] = Proc.new { |str| IconvCharset.safe_iconv("shift-jis", "utf-8", str) }
- EncodingConvertMap[['SJIS', 'UTF8']] = Proc.new { |str| IconvCharset.safe_iconv("utf-8", "shift-jis", str) }
- EncodingConvertMap[['SJIS', 'EUC' ]] = Proc.new { |str| IconvCharset.safe_iconv("euc-jp", "shift-jis", str) }
+ EncodingConvertMap[['UTF8', 'SJIS']] = Proc.new { |str| IconvCharset.safe_iconv("shift_jis", "utf-8", str) }
+ EncodingConvertMap[['SJIS', 'UTF8']] = Proc.new { |str| IconvCharset.safe_iconv("utf-8", "shift_jis", str) }
+ EncodingConvertMap[['SJIS', 'EUC' ]] = Proc.new { |str| IconvCharset.safe_iconv("euc-jp", "shift_jis", str) }
end
rescue LoadError
begin
diff --git a/lib/xsd/datatypes.rb b/lib/xsd/datatypes.rb
index f6ec83be71..ca4ef15576 100644
--- a/lib/xsd/datatypes.rb
+++ b/lib/xsd/datatypes.rb
@@ -1,20 +1,9 @@
-=begin
-XSD4R - XML Schema Datatype implementation.
-Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# XSD4R - XML Schema Datatype implementation.
+# Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/qname'
diff --git a/lib/xsd/datatypes1999.rb b/lib/xsd/datatypes1999.rb
index 6b6b6be20a..c7d6479e54 100644
--- a/lib/xsd/datatypes1999.rb
+++ b/lib/xsd/datatypes1999.rb
@@ -1,20 +1,9 @@
-=begin
-XSD4R - XML Schema Datatype 1999 support
-Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
+# XSD4R - XML Schema Datatype 1999 support
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/datatypes'
diff --git a/lib/xsd/iconvcharset.rb b/lib/xsd/iconvcharset.rb
index f607b7db45..cac66515e2 100644
--- a/lib/xsd/iconvcharset.rb
+++ b/lib/xsd/iconvcharset.rb
@@ -1,20 +1,9 @@
-=begin
-XSD4R - Charset handling with iconv.
-Copyright (C) 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# XSD4R - Charset handling with iconv.
+# Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'iconv'
diff --git a/lib/xsd/namedelements.rb b/lib/xsd/namedelements.rb
index df749fed72..b6f909c1dc 100644
--- a/lib/xsd/namedelements.rb
+++ b/lib/xsd/namedelements.rb
@@ -1,20 +1,9 @@
-=begin
-XSD4R - WSDL named element collection.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# XSD4R - WSDL named element collection.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
module XSD
diff --git a/lib/xsd/ns.rb b/lib/xsd/ns.rb
index 0767b2c30d..224db6c058 100644
--- a/lib/xsd/ns.rb
+++ b/lib/xsd/ns.rb
@@ -1,20 +1,9 @@
-=begin
-XSD4R - XML Schema Namespace library
-Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# XSD4R - XML Schema Namespace library
+# Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/datatypes'
diff --git a/lib/xsd/qname.rb b/lib/xsd/qname.rb
index 150a837c1d..9dce1340f8 100644
--- a/lib/xsd/qname.rb
+++ b/lib/xsd/qname.rb
@@ -1,20 +1,9 @@
-=begin
-XSD4R - XML QName definition.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# XSD4R - XML QName definition.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
module XSD
diff --git a/lib/xsd/xmlparser.rb b/lib/xsd/xmlparser.rb
index 7d6d389261..1f87ae2e4d 100644
--- a/lib/xsd/xmlparser.rb
+++ b/lib/xsd/xmlparser.rb
@@ -1,20 +1,9 @@
-=begin
-XSD4R - XML Instance parser library.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# XSD4R - XML Instance parser library.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/xmlparser/parser'
diff --git a/lib/xsd/xmlparser/parser.rb b/lib/xsd/xmlparser/parser.rb
index 0c7fd48084..ad01d55aa0 100644
--- a/lib/xsd/xmlparser/parser.rb
+++ b/lib/xsd/xmlparser/parser.rb
@@ -1,20 +1,9 @@
-=begin
-XSD4R - XML Instance parser library.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+# XSD4R - XML Instance parser library.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/qname'
@@ -57,7 +46,7 @@ public
def initialize(host, opt = {})
@host = host
- @charset = opt[:charset] || 'us-ascii'
+ @charset = opt[:charset] || nil
end
def parse(string_or_readable)
diff --git a/lib/xsd/xmlparser/rexmlparser.rb b/lib/xsd/xmlparser/rexmlparser.rb
index 2500d432d8..61da9aafc7 100644
--- a/lib/xsd/xmlparser/rexmlparser.rb
+++ b/lib/xsd/xmlparser/rexmlparser.rb
@@ -1,20 +1,9 @@
-=begin
-XSD4R - REXMLParser XML parser library.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# XSD4R - REXMLParser XML parser library.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/xmlparser'
diff --git a/lib/xsd/xmlparser/xmlparser.rb b/lib/xsd/xmlparser/xmlparser.rb
index f555b99b26..6db914cd37 100644
--- a/lib/xsd/xmlparser/xmlparser.rb
+++ b/lib/xsd/xmlparser/xmlparser.rb
@@ -1,20 +1,9 @@
-=begin
-XSD4R - XMLParser XML parser library.
-Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# XSD4R - XMLParser XML parser library.
+# Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/xmlparser'
diff --git a/lib/xsd/xmlparser/xmlscanner.rb b/lib/xsd/xmlparser/xmlscanner.rb
index c10e275b9e..c2ad51be52 100644
--- a/lib/xsd/xmlparser/xmlscanner.rb
+++ b/lib/xsd/xmlparser/xmlscanner.rb
@@ -1,20 +1,9 @@
-=begin
-XSD4R - XMLScan XML parser library.
-Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PRATICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 675 Mass
-Ave, Cambridge, MA 02139, USA.
-=end
+# XSD4R - XMLScan XML parser library.
+# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
require 'xsd/xmlparser'
diff --git a/sample/soap/digraph.rb b/sample/soap/digraph.rb
index bf4a650cfe..54ff302592 100644
--- a/sample/soap/digraph.rb
+++ b/sample/soap/digraph.rb
@@ -27,7 +27,7 @@ File.open("digraph_marshalled_string.soap", "wb") do |f|
SOAP::Marshal.dump(n1, f)
end
-marshalledString = File.open("digraph_marshalled_string.soap").read
+marshalledString = File.open("digraph_marshalled_string.soap") { |f| f.read }
puts marshalledString
diff --git a/sample/wsdl/amazon/wsdlDriver.rb b/sample/wsdl/amazon/wsdlDriver.rb
index 00ef6135a4..6b2dce376b 100644
--- a/sample/wsdl/amazon/wsdlDriver.rb
+++ b/sample/wsdl/amazon/wsdlDriver.rb
@@ -30,7 +30,7 @@ end
=end
# You must get 'developer's token" from http://associates.amazon.com/exec/panama/associates/ntg/browse/-/1067662 to use Amazon Web Services 2.0.
-#devtag = File.open(File.expand_path("~/.amazon_key")).read.chomp
+#devtag = File.open(File.expand_path("~/.amazon_key")) { |f| f.read }.chomp
devtag = nil
# v2: AMAZON_WSDL = 'http://soap.amazon.com/schemas2/AmazonWebServices.wsdl'
diff --git a/sample/wsdl/googleSearch/sampleClient.rb b/sample/wsdl/googleSearch/sampleClient.rb
index 38e7253ef5..b05d57be54 100644
--- a/sample/wsdl/googleSearch/sampleClient.rb
+++ b/sample/wsdl/googleSearch/sampleClient.rb
@@ -37,7 +37,7 @@ obj = GoogleSearchPort.new(endpoint_url)
# N/A
#
key = q = start = maxResults = filter = restrict = safeSearch = lr = ie = oe = nil
-key = File.open(File.expand_path("~/.google_key")).read.chomp
+key = File.open(File.expand_path("~/.google_key")) { |f| f.read }.chomp
q = "Ruby"
start = 0
maxResults = 10
diff --git a/sample/wsdl/googleSearch/wsdlDriver.rb b/sample/wsdl/googleSearch/wsdlDriver.rb
index e8b91abfe2..9059aed2df 100644
--- a/sample/wsdl/googleSearch/wsdlDriver.rb
+++ b/sample/wsdl/googleSearch/wsdlDriver.rb
@@ -3,7 +3,7 @@ require 'soap/wsdlDriver'
word = ARGV.shift
# You must get key from http://www.google.com/apis/ to use Google Web APIs.
-key = File.open(File.expand_path("~/.google_key")).read.chomp
+key = File.open(File.expand_path("~/.google_key")) { |f| f.read }.chomp
GOOGLE_WSDL = 'http://api.google.com/GoogleSearch.wsdl'
# GOOGLE_WSDL = 'GoogleSearch.wsdl'
diff --git a/test/wsdl/axisArray/axisArray.wsdl b/test/wsdl/axisArray/axisArray.wsdl
new file mode 100644
index 0000000000..3602edb748
--- /dev/null
+++ b/test/wsdl/axisArray/axisArray.wsdl
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name = "itemList"
+ targetNamespace="urn:jp.gr.jin.rrr.example.itemList"
+ xmlns:tns="urn:jp.gr.jin.rrr.example.itemList"
+ xmlns:typens="urn:jp.gr.jin.rrr.example.itemListType"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+ <schema targetNamespace="urn:jp.gr.jin.rrr.example.itemListType"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="Item">
+ <sequence>
+ <element name="name" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ <complexType name="ItemList">
+ <sequence>
+ <element maxOccurs="unbounded" minOccurs="0" name="Item" type="typens:Item"/>
+ </sequence>
+ </complexType>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="listItemRequest"/>
+
+ <wsdl:message name="listItemResponse">
+ <wsdl:part name="list" type="typens:ItemList"/>
+ </wsdl:message>
+
+ <wsdl:portType name="ItemListPortType">
+ <wsdl:operation name="listItem">
+ <wsdl:input message="tns:listItemRequest" name="listItemRequest"/>
+ <wsdl:output message="tns:listItemResponse" name="listItemResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="ItemListBinding" type="tns:ItemListPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="listItem">
+ <soap:operation soapAction=""/>
+ <wsdl:input name="listItemRequest">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:jp.gr.jin.rrr.example.itemList" use="encoded"/>
+ </wsdl:input>
+ <wsdl:output name="listItemResponse">
+ <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:jp.gr.jin.rrr.example.itemList" use="encoded"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="ItemListService">
+ <wsdl:port binding="tns:ItemListBinding" name="ItemListPort">
+ <soap:address location="http://localhost:10080/"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/test/wsdl/axisArray/itemList.rb b/test/wsdl/axisArray/itemList.rb
new file mode 100644
index 0000000000..b81297ed37
--- /dev/null
+++ b/test/wsdl/axisArray/itemList.rb
@@ -0,0 +1,27 @@
+# Generated by wsdl2ruby.rb with axisArray.wsdl.
+
+# urn:jp.gr.jin.rrr.example.itemListType
+class Item
+ @@schema_type = "Item"
+ @@schema_ns = "urn:jp.gr.jin.rrr.example.itemListType"
+
+ def name
+ @name
+ end
+
+ def name=(value)
+ @name = value
+ end
+
+ def initialize(name = nil)
+ @name = name
+ end
+end
+
+# urn:jp.gr.jin.rrr.example.itemListType
+class ItemList < Array
+ # Contents type should be dumped here...
+ @@schema_type = "ItemList"
+ @@schema_ns = "urn:jp.gr.jin.rrr.example.itemListType"
+end
+
diff --git a/test/wsdl/axisArray/test_axisarray.rb b/test/wsdl/axisArray/test_axisarray.rb
new file mode 100644
index 0000000000..9c7b42564c
--- /dev/null
+++ b/test/wsdl/axisArray/test_axisarray.rb
@@ -0,0 +1,72 @@
+require 'test/unit'
+require 'soap/processor'
+require 'soap/mapping'
+require 'soap/rpc/element'
+require 'wsdl/importer'
+
+
+module WSDL
+
+
+class TestAxisArray < Test::Unit::TestCase
+ def setup
+ dir = File.dirname(File.expand_path(__FILE__))
+ $:.push(dir)
+ require 'itemList.rb'
+ $:.delete(dir)
+ @xml =<<__EOX__
+<?xml version="1.0" encoding="UTF-8"?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <soapenv:Body>
+ <ns1:listItemResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:jp.gr.jin.rrr.example.itemList">
+ <list href="#id0"/>
+ </ns1:listItemResponse>
+ <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:ItemList" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="urn:jp.gr.jin.rrr.example.itemListType">
+ <Item href="#id1"/>
+ <Item href="#id2"/>
+ <Item href="#id3"/>
+ </multiRef>
+ <multiRef id="id3" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:Item" xmlns:ns3="urn:jp.gr.jin.rrr.example.itemListType" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
+ <name xsi:type="xsd:string">name3</name>
+ </multiRef>
+ <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:Item" xmlns:ns4="urn:jp.gr.jin.rrr.example.itemListType" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
+ <name xsi:type="xsd:string">name1</name>
+ </multiRef>
+ <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:Item" xmlns:ns5="urn:jp.gr.jin.rrr.example.itemListType" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
+ <name xsi:type="xsd:string">name2</name>
+ </multiRef>
+ </soapenv:Body>
+</soapenv:Envelope>
+__EOX__
+ end
+
+ def test_by_stub
+ header, body = ::SOAP::Processor.unmarshal(@xml)
+ ary = ::SOAP::Mapping.soap2obj(body.response)
+ assert_equal(3, ary.size)
+ assert_equal("name1", ary[0].name)
+ assert_equal("name2", ary[1].name)
+ assert_equal("name3", ary[2].name)
+ end
+
+ def test_by_wsdl
+ wsdlfile = File.join(File.dirname(File.expand_path(__FILE__)), 'axisArray.wsdl')
+ wsdl = WSDL::Importer.import(wsdlfile)
+ service = wsdl.services[0]
+ port = service.ports[0]
+ wsdl_types = wsdl.collect_complextypes
+ rpc_decode_typemap = wsdl_types + wsdl.soap_rpc_complextypes(port.find_binding)
+ opt = {}
+ opt[:default_encodingstyle] = ::SOAP::EncodingNamespace
+ opt[:decode_typemap] = rpc_decode_typemap
+ header, body = ::SOAP::Processor.unmarshal(@xml, opt)
+ ary = ::SOAP::Mapping.soap2obj(body.response)
+ assert_equal(3, ary.size)
+ assert_equal("name1", ary[0].name)
+ assert_equal("name2", ary[1].name)
+ assert_equal("name3", ary[2].name)
+ end
+end
+
+
+end
diff --git a/test/wsdl/emptycomplextype.wsdl b/test/wsdl/emptycomplextype.wsdl
index afd8dc239f..4f8dc4849c 100644
--- a/test/wsdl/emptycomplextype.wsdl
+++ b/test/wsdl/emptycomplextype.wsdl
@@ -1,77 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
-<definitions
- xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:i1="http://www.winfessor.com/SoapBoxWebService/RosterDataSet.xsd"
- xmlns:s="http://www.w3.org/2001/XMLSchema"
- xmlns:s0="http://www.winfessor.com/SoapBoxWebService/SoapBoxWebService"
- xmlns:i2="http://www.winfessor.com/SoapBoxWebService/ExceptionDataSet.xsd"
- xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:i0="http://www.winfessor.com/SoapBoxWebService/MessageDataSet.xsd"
- xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
- targetNamespace="http://www.winfessor.com/SoapBoxWebService/SoapBoxWebService"
+<definitions name = "emptycomplextype"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jp.gr.jin.rrr.example.emptycomplextype"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
- <s:schema
- elementFormDefault="qualified"
- targetNamespace="http://www.winfessor.com/SoapBoxWebService/SoapBoxWebService">
- <s:element name="typeIn">
- <s:complexType />
- </s:element>
+ <xsd:schema elementFormDefault="qualified"
+ targetNamespace="urn:jp.gr.jin.rrr.example.emptycomplextype">
+ <xsd:element name="typeIn">
+ <xsd:complexType />
+ </xsd:element>
- <s:element name="typeOut">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="str1" type="s:string" />
- <s:element minOccurs="0" maxOccurs="1" name="str2" type="s:string" />
- <s:element minOccurs="0" maxOccurs="1" name="seq">
- <s:complexType>
- <s:sequence>
- <s:any />
- </s:sequence>
- </s:complexType>
- </s:element>
- </s:sequence>
- </s:complexType>
- </s:element>
- </s:schema>
+ <xsd:element name="typeOut">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element minOccurs="0" maxOccurs="1" name="str1" type="xsd:string" />
+ <xsd:element minOccurs="0" maxOccurs="1" name="str2" type="xsd:string" />
+ <xsd:element minOccurs="0" maxOccurs="1" name="seq">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:any />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
</types>
-
- <message name="doIn">
- <part name="parameters" element="s0:typeIn" />
- </message>
- <message name="doOut">
- <part name="parameters" element="s0:typeOut" />
- </message>
-
- <portType name="DotNetPortType">
- <operation name="do">
- <input message="s0:doIn" />
- <output message="s0:doOut" />
- </operation>
- </portType>
-
- <binding name="DotNetBinding" type="s0:DotNetPortType">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <operation name="do">
- <soap:operation soapAction="http://www.winfessor.com/SoapBoxWebService/SoapBoxWebService/SessionClose" style="document" />
- <input>
- <soap:body use="literal" />
- <soap:header message="s0:SessionCloseSoapBoxHeader" part="SoapBoxHeader" use="literal" />
- </input>
- <output>
- <soap:body use="literal" />
- <soap:header message="s0:SessionCloseSoapBoxHeader" part="SoapBoxHeader" use="literal" />
- </output>
- </operation>
- </binding>
-
- <service name="DotNetService">
- <documentation>doc doc doc.</documentation>
- <port name="DotNetPort" binding="s0:DotNetBinding">
- <soap:address location="http://localhost:8808" />
- <!-- <soap:address location="http://www.winfessor.com/SoapBoxWebservice/SoapBoxWebService.asmx" /> -->
- </port>
- </service>
</definitions>
diff --git a/test/wsdl/multiplefault.wsdl b/test/wsdl/multiplefault.wsdl
new file mode 100644
index 0000000000..2d928b60b0
--- /dev/null
+++ b/test/wsdl/multiplefault.wsdl
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<definitions name="MultipleFaultTest"
+ targetNamespace="urn:jp.gr.jin.rrr.example.ele"
+ xmlns:tns="urn:jp.gr.jin.rrr.example.ele"
+ xmlns:typens="urn:jp.gr.jin.rrr.example.datatypes"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jp.gr.jin.rrr.example.datatypes">
+ <xsd:complexType name="AuthenticationError">
+ <all>
+ <element name="message" type="xsd:string" />
+ <element name="backtrace" type="xoapenc:Array" />
+ </all>
+ </xsd:complexType>
+ <xsd:complexType name="AuthorizationError">
+ <all>
+ <element name="message" type="xsd:string" />
+ <element name="backtrace" type="xoapenc:Array" />
+ </all>
+ </xsd:complexType>
+ </xsd:schema>
+ </types>
+
+ <message name="inputmsg"/>
+ <message name="outputmsg"/>
+ <message name="faultmsg1" >
+ <part name="exception" type="typens:AuthenticationError" />
+ </message>
+ <message name="faultmsg2" >
+ <part name="exception" type="typens:AuthorizationError" />
+ </message>
+
+ <portType name="MultipleFaultPortType">
+ <operation name="myoperation">
+ <input message="tns:inputmsg"/>
+ <output message="tns:outputmsg"/>
+ <fault message="tns:faultmsg1"/>
+ <fault message="tns:faultmsg2"/>
+ </operation>
+ </portType>
+
+ <binding name="MultipleFaultBinding" type="tns:MultipleFaultPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="myoperation">
+ <soap:operation soapAction="urn:jp.gr.jin.rrr.example.ele"/>
+ <input>
+ <soap:body use="encoded" namespace="urn:jp.gr.jin.rrr.example.ele"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body use="encoded" namespace="urn:jp.gr.jin.rrr.example.ele"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="MultipleFaultService">
+ <port name="MultipleFaultPortType" binding="tns:MultipleFaultBinding">
+ <soap:address location="http://localhost:17171/"/>
+ </port>
+ </service>
+</definitions>
diff --git a/test/wsdl/test_emptycomplextype.rb b/test/wsdl/test_emptycomplextype.rb
index fffc8c85ec..45136b417d 100644
--- a/test/wsdl/test_emptycomplextype.rb
+++ b/test/wsdl/test_emptycomplextype.rb
@@ -6,16 +6,16 @@ module WSDL
class TestWSDL < Test::Unit::TestCase
- def self.setup(filename)
- @@filename = filename
+ def setup
+ @file = File.join(File.dirname(__FILE__), 'emptycomplextype.wsdl')
end
def test_wsdl
- @wsdl = WSDL::Parser.new.parse(File.open(@@filename).read)
+ @wsdl = WSDL::Parser.new.parse(File.open(@file) { |f| f.read })
+ assert_equal("#<WSDL::Definitions:{urn:jp.gr.jin.rrr.example.emptycomplextype}emptycomplextype>", @wsdl.inspect)
end
end
-TestWSDL.setup(File.join(File.dirname(__FILE__), 'emptycomplextype.wsdl'))
end
diff --git a/test/wsdl/test_multiplefault.rb b/test/wsdl/test_multiplefault.rb
new file mode 100644
index 0000000000..7004297dc9
--- /dev/null
+++ b/test/wsdl/test_multiplefault.rb
@@ -0,0 +1,39 @@
+require 'test/unit'
+require 'wsdl/parser'
+require 'wsdl/soap/classDefCreator'
+
+
+module WSDL
+
+
+class TestMultipleFault < Test::Unit::TestCase
+ def self.setup(filename)
+ @@filename = filename
+ end
+
+ def test_multiplefault
+ @wsdl = WSDL::Parser.new.parse(File.open(@@filename) { |f| f.read })
+ classdefstr = WSDL::SOAP::ClassDefCreator.new(@wsdl).dump
+ yield_eval_binding(classdefstr) do |b|
+ assert_equal(
+ WSDL::TestMultipleFault::AuthenticationError,
+ eval("AuthenticationError", b)
+ )
+ assert_equal(
+ WSDL::TestMultipleFault::AuthorizationError,
+ eval("AuthorizationError", b)
+ )
+ end
+ end
+
+ def yield_eval_binding(evaled)
+ b = binding
+ eval(evaled, b)
+ yield(b)
+ end
+end
+
+TestMultipleFault.setup(File.join(File.dirname(__FILE__), 'multiplefault.wsdl'))
+
+
+end
diff --git a/test/xsd/test_xmlschemaparser.rb b/test/xsd/test_xmlschemaparser.rb
index b362120540..ab9421c954 100644
--- a/test/xsd/test_xmlschemaparser.rb
+++ b/test/xsd/test_xmlschemaparser.rb
@@ -6,16 +6,17 @@ module XSD
class TestXMLSchemaParser < Test::Unit::TestCase
- def self.setup(filename)
- @@filename = filename
+ def setup
+ @file = File.join(File.dirname(__FILE__), 'xmlschema.xml')
end
def test_wsdl
- @wsdl = WSDL::XMLSchema::Parser.new.parse(File.open(@@filename).read)
+ @wsdl = WSDL::XMLSchema::Parser.new.parse(File.open(@file) { |f| f.read })
+ assert_equal(WSDL::XMLSchema::Schema, @wsdl.class)
+ assert_equal(1, @wsdl.collect_elements.size)
end
end
-TestXMLSchemaParser.setup(File.join(File.dirname(__FILE__), 'xmlschema.xml'))
end
diff --git a/test/xsd/xmlschema.xml b/test/xsd/xmlschema.xml
index 0e9914e64b..018bd0cc67 100644
--- a/test/xsd/xmlschema.xml
+++ b/test/xsd/xmlschema.xml
@@ -1,11 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema
- xmlns:mstns="http://www.winfessor.com/SoapBoxWebService/MessageDataSet.xsd"
- xmlns="http://www.winfessor.com/SoapBoxWebService/MessageDataSet.xsd"
attributeFormDefault="qualified"
elementFormDefault="qualified"
- targetNamespace="http://www.winfessor.com/SoapBoxWebService/MessageDataSet.xsd"
- id="MessageDataSet"
+ targetNamespace="urn:jp.gr.jin.rrr.example.fakeschema"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="MessageDataSet">
<xs:complexType>