* 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.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nahi 2003-11-25 07:31:33 +00:00
parent ec373c3e1c
commit 6a09e1d966
98 changed files with 1020 additions and 1558 deletions

View File

@ -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> Tue Nov 25 16:15:29 2003 WATANABE Hirofumi <eban@ruby-lang.org>
* ruby.h: don't treat Cygwin as Windows. * ruby.h: don't treat Cygwin as Windows.

View File

@ -725,13 +725,18 @@ test/uri/test_generic.rb
test/uri/test_http.rb test/uri/test_http.rb
test/uri/test_ldap.rb test/uri/test_ldap.rb
test/uri/test_mailto.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/emptycomplextype.wsdl
test/wsdl/multiplefault.wsdl
test/wsdl/raa/RAA.rb test/wsdl/raa/RAA.rb
test/wsdl/raa/README.txt test/wsdl/raa/README.txt
test/wsdl/raa/raa.wsdl test/wsdl/raa/raa.wsdl
test/wsdl/raa/server.rb test/wsdl/raa/server.rb
test/wsdl/raa/test_raa.rb test/wsdl/raa/test_raa.rb
test/wsdl/test_emptycomplextype.rb test/wsdl/test_emptycomplextype.rb
test/wsdl/test_multiplefault.rb
test/xsd/test_xmlschemaparser.rb test/xsd/test_xmlschemaparser.rb
test/xsd/test_xsd.rb test/xsd/test_xsd.rb
test/xsd/xmlschema.xml test/xsd/xmlschema.xml

View File

@ -1,20 +1,9 @@
=begin # soap/baseData.rb: SOAP4R - Base type library
SOAP4R - Base type library # Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/datatypes' require 'xsd/datatypes'
@ -408,7 +397,7 @@ public
private private
def add_member(name, value = nil) def add_member(name, value = nil)
value = SOAPNil.new() unless value value = SOAPNil.new() if value.nil?
@array.push(name) @array.push(name)
value.elename = value.elename.dup_name(name) value.elename = value.elename.dup_name(name)
@data.push(value) @data.push(value)

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - SOAP elements library
SOAP4R - SOAP elements library # Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/qname' require 'xsd/qname'

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - ASP.NET EncodingStyle handler library
SOAP4R - ASP.NET EncodingStyle handler library # Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'soap/encodingstyle/handler' require 'soap/encodingstyle/handler'

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - EncodingStyle handler library
SOAP4R - EncodingStyle handler library # Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'soap/soap' require 'soap/soap'

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - XML Literal EncodingStyle handler library
SOAP4R - XML Literal EncodingStyle handler library # Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'soap/encodingstyle/handler' require 'soap/encodingstyle/handler'

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - SOAP EncodingStyle handler library
SOAP4R - SOAP EncodingStyle handler library # Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'soap/encodingstyle/handler' require 'soap/encodingstyle/handler'
@ -172,10 +161,9 @@ class SOAPHandler < Handler
elsif href elsif href
o = SOAPReference.decode(elename, href) o = SOAPReference.decode(elename, href)
@refpool << o @refpool << o
elsif @decode_typemap && elsif @decode_typemap
(parent.node.class != SOAPBody || @is_first_top_ele) # to parse multi-ref element with decode_tag_by_type.
# multi-ref element should be parsed by decode_tag_by_type. # && (parent.node.class != SOAPBody || @is_first_top_ele)
@is_first_top_ele = false
o = decode_tag_by_wsdl(ns, elename, type, parent.node, arytype, extraattr) o = decode_tag_by_wsdl(ns, elename, type, parent.node, arytype, extraattr)
else else
o = decode_tag_by_type(ns, elename, type, parent.node, arytype, extraattr) o = decode_tag_by_type(ns, elename, type, parent.node, arytype, extraattr)
@ -344,15 +332,30 @@ private
end end
def decode_tag_by_wsdl(ns, elename, typestr, parent, arytypestr, extraattr) def decode_tag_by_wsdl(ns, elename, typestr, parent, arytypestr, extraattr)
o = nil
if parent.class == SOAPBody if parent.class == SOAPBody
if @is_first_top_ele
# Unqualified name is allowed here. # Unqualified name is allowed here.
type = @decode_typemap[elename] || @decode_typemap.find_name(elename.name) @is_first_top_ele = false
type = @decode_typemap[elename] ||
@decode_typemap.find_name(elename.name)
unless type unless type
raise EncodingStyleError.new("Unknown operation '#{ elename }'.") raise EncodingStyleError.new("Unknown operation '#{ elename }'.")
end end
o = SOAPStruct.new(elename) o = SOAPStruct.new(elename)
o.definedtype = type o.definedtype = type
return o 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
end end
if parent.type == XSD::AnyTypeName if parent.type == XSD::AnyTypeName
@ -366,41 +369,41 @@ private
unless parenttype unless parenttype
raise EncodingStyleError.new("Unknown type '#{ parent.type }'.") raise EncodingStyleError.new("Unknown type '#{ parent.type }'.")
end end
typename = parenttype.child_type(elename)
if typename definedtype_name = parenttype.child_type(elename)
if (klass = TypeMap[typename]) if definedtype_name and (klass = TypeMap[definedtype_name])
return klass.decode(elename) return klass.decode(elename)
elsif typename == XSD::AnyTypeName elsif definedtype_name == XSD::AnyTypeName
return decode_tag_by_type(ns, elename, typestr, parent, arytypestr, return decode_tag_by_type(ns, elename, typestr, parent, arytypestr,
extraattr) extraattr)
end end
typedef = definedtype_name ? @decode_typemap[definedtype_name] :
parenttype.child_defined_complextype(elename)
decode_defined_compoundtype(elename, definedtype_name, typedef, arytypestr)
end end
type = if typename def decode_defined_compoundtype(elename, typename, typedef, arytypestr)
@decode_typemap[typename] unless typedef
else
parenttype.child_defined_complextype(elename)
end
unless type
raise EncodingStyleError.new("Unknown type '#{ typename }'.") raise EncodingStyleError.new("Unknown type '#{ typename }'.")
end end
case typedef.compoundtype
case type.compoundtype
when :TYPE_STRUCT when :TYPE_STRUCT
o = SOAPStruct.decode(elename, typename) o = SOAPStruct.decode(elename, typename)
o.definedtype = type o.definedtype = typedef
return o return o
when :TYPE_ARRAY when :TYPE_ARRAY
expected_arytype = type.find_arytype expected_arytype = typedef.find_arytype
actual_arytype = if arytypestr if arytypestr
XSD::QName.new(expected_arytype.namespace, actual_arytype = XSD::QName.new(expected_arytype.namespace,
content_typename(expected_arytype.name) << content_typename(expected_arytype.name) <<
content_ranksize(arytypestr)) content_ranksize(arytypestr))
else
expected_arytype
end
o = SOAPArray.decode(elename, typename, actual_arytype) o = SOAPArray.decode(elename, typename, actual_arytype)
o.definedtype = type else
o = SOAPArray.new(typename, 1, expected_arytype)
o.elename = elename
end
o.definedtype = typedef
return o return o
end end
return nil return nil

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - SOAP XML Instance Generator library.
SOAP4R - SOAP XML Instance Generator library. # Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/ns' require 'xsd/ns'

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - Ruby type mapping utility.
SOAP4R - Ruby type mapping utility. # Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'soap/mapping/mapping' require 'soap/mapping/mapping'

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - Mapping factory.
SOAP4R - Mapping factory. # Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
module SOAP module SOAP
@ -73,11 +62,11 @@ class Factory
def setiv2obj(obj, node, map) def setiv2obj(obj, node, map)
return if node.nil? return if node.nil?
vars = {} if obj.is_a?(Array)
node.each do |name, value| setiv2ary(obj, node, map)
vars[Mapping.elename2name(name)] = Mapping._soap2obj(value, map) else
setiv2struct(obj, node, map)
end end
Mapping.set_instance_vars(obj, vars)
end end
def setiv2soap(node, obj, map) def setiv2soap(node, obj, map)
@ -105,6 +94,22 @@ class Factory
def capitalize(target) def capitalize(target)
target.gsub(/^([a-z])/) { $1.tr!('[a-z]', '[A-Z]') } target.gsub(/^([a-z])/) { $1.tr!('[a-z]', '[A-Z]') }
end 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 end
class StringFactory_ < Factory class StringFactory_ < Factory

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - Ruby type mapping utility.
SOAP4R - Ruby type mapping utility. # Copyright (C) 2000, 2001, 2003 NAKAMURA Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2003 NAKAMURA Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
module SOAP module SOAP

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - Mapping registry.
SOAP4R - Mapping registry. # Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'soap/baseData' require 'soap/baseData'
@ -145,7 +134,7 @@ class Registry
@registry = registry @registry = registry
end end
def obj2soap(klass, obj) def obj2soap(klass, obj, type_qname = nil)
@map.each do |obj_class, soap_class, factory, info| @map.each do |obj_class, soap_class, factory, info|
if klass == obj_class or if klass == obj_class or
(info[:derived_class] and klass <= obj_class) (info[:derived_class] and klass <= obj_class)
@ -330,8 +319,8 @@ class Registry
alias :set :add alias :set :add
# This mapping registry ignores type hint. # This mapping registry ignores type hint.
def obj2soap(klass, obj, type = nil) def obj2soap(klass, obj, type_qname = nil)
soap = _obj2soap(klass, obj, type) soap = _obj2soap(klass, obj, type_qname)
if @allow_original_mapping if @allow_original_mapping
addextend2soap(soap, obj) addextend2soap(soap, obj)
end end
@ -369,7 +358,7 @@ class Registry
private private
def _obj2soap(klass, obj, type) def _obj2soap(klass, obj, type_qname)
ret = nil ret = nil
if obj.is_a?(SOAPStruct) or obj.is_a?(SOAPArray) if obj.is_a?(SOAPStruct) or obj.is_a?(SOAPArray)
obj.replace do |ele| obj.replace do |ele|
@ -380,7 +369,7 @@ private
return obj return obj
end end
begin begin
ret = @map.obj2soap(klass, obj) || ret = @map.obj2soap(klass, obj, type_qname) ||
@default_factory.obj2soap(klass, obj, nil, self) @default_factory.obj2soap(klass, obj, nil, self)
rescue MappingError rescue MappingError
end end

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - Ruby type mapping factory.
SOAP4R - Ruby type mapping factory. # Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
module SOAP module SOAP

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - Base type mapping definition
SOAP4R - Base type mapping definition # Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
module SOAP module SOAP

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - WSDL mapping registry.
SOAP4R - WSDL mapping registry. # Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'soap/baseData' require 'soap/baseData'

View File

@ -1,25 +1,9 @@
=begin # SOAP4R - Marshalling/Unmarshalling Ruby's object using SOAP Encoding.
SOAP4R - Marshalling/Unmarshalling Ruby's object using SOAP Encoding. # Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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.
require "soap/mapping" require "soap/mapping"
@ -58,7 +42,9 @@ module Marshal
def unmarshal(stream, mapping_registry = MarshalMappingRegistry) def unmarshal(stream, mapping_registry = MarshalMappingRegistry)
header, body = SOAP::Processor.unmarshal(stream) 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) Mapping.soap2obj(body.root_node, mapping_registry)
end end
end end

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - net/http wrapper
SOAP4R - net/http wrapper # Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'net/http' require 'net/http'
@ -25,6 +14,13 @@ module SOAP
class NetHttpClient class NetHttpClient
SSLEnabled = begin
require 'net/https'
true
rescue LoadError
false
end
attr_accessor :proxy attr_accessor :proxy
attr_accessor :no_proxy attr_accessor :no_proxy
attr_accessor :debug_dev attr_accessor :debug_dev
@ -86,20 +82,39 @@ class NetHttpClient
private private
def start(url) 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 proxy_host = proxy_port = nil
unless no_proxy?(url) unless no_proxy?(url)
proxy_host = @proxy.host proxy_host = @proxy.host
proxy_port = @proxy.port proxy_port = @proxy.port
end end
response = nil http = Net::HTTP::Proxy(proxy_host, proxy_port).new(url.host, url.port)
Net::HTTP::Proxy(proxy_host, proxy_port).start(url.host, url.port) { |http|
if http.respond_to?(:set_debug_output) if http.respond_to?(:set_debug_output)
http.set_debug_output(@debug_dev) http.set_debug_output(@debug_dev)
end end
response, = yield(http) case url
http.finish when URI::HTTPS
} if SSLEnabled
response http.use_ssl = true
else
raise RuntimeError.new("Cannot connect to #{url} (OpenSSL is not installed.)")
end
when URI::HTTP
# OK
else
raise RuntimeError.new("Cannot connect to #{url} (Not HTTP.)")
end
http
end end
NO_PROXY_HOSTS = ['localhost'] NO_PROXY_HOSTS = ['localhost']

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - SOAP XML Instance Parser library.
SOAP4R - SOAP XML Instance Parser library. # Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/ns' require 'xsd/ns'

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - marshal/unmarshal interface.
SOAP4R - marshal/unmarshal interface. # Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/datatypes' require 'xsd/datatypes'

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - CGI stub library
SOAP4R - CGI stub library # Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'soap/streamHandler' require 'soap/streamHandler'

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - SOAP RPC driver
SOAP4R - SOAP RPC driver # Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'soap/soap' require 'soap/soap'
@ -35,51 +24,63 @@ public
attr_accessor :mapping_registry attr_accessor :mapping_registry
attr_accessor :soapaction attr_accessor :soapaction
attr_reader :endpoint_url
attr_reader :wiredump_dev attr_reader :wiredump_dev
attr_reader :wiredump_file_base attr_reader :wiredump_file_base
attr_reader :httpproxy attr_reader :streamhandler
def initialize(endpoint_url, namespace, soapaction = nil) def initialize(endpoint_url, namespace, soapaction = nil)
@endpoint_url = endpoint_url
@namespace = namespace @namespace = namespace
@mapping_registry = nil # for unmarshal @mapping_registry = nil # for unmarshal
@soapaction = soapaction @soapaction = soapaction
@wiredump_dev = nil @wiredump_dev = nil
@wiredump_file_base = nil @wiredump_file_base = nil
@httpproxy = ENV['httpproxy'] || ENV['HTTP_PROXY'] name = 'http_proxy'
@handler = HTTPPostStreamHandler.new(@endpoint_url, @httpproxy, @httpproxy = ENV[name] || ENV[name.upcase]
@streamhandler = HTTPPostStreamHandler.new(endpoint_url, @httpproxy,
XSD::Charset.encoding_label) XSD::Charset.encoding_label)
@proxy = Proxy.new(@handler, @soapaction) @proxy = Proxy.new(@streamhandler, @soapaction)
@proxy.allow_unqualified_element = true @proxy.allow_unqualified_element = true
end end
def endpoint_url=(endpoint_url) def inspect
@endpoint_url = endpoint_url "#<#{self.class}:#{@streamhandler.inspect}>"
if @handler
@handler.endpoint_url = @endpoint_url
@handler.reset
end end
def endpoint_url
@streamhandler.endpoint_url
end
def endpoint_url=(endpoint_url)
@streamhandler.endpoint_url = endpoint_url
@streamhandler.reset
end end
def wiredump_dev=(dev) def wiredump_dev=(dev)
@wiredump_dev = dev @wiredump_dev = dev
if @handler @streamhandler.wiredump_dev = @wiredump_dev
@handler.wiredump_dev = @wiredump_dev @streamhandler.reset
@handler.reset
end
end end
def wiredump_file_base=(base) def wiredump_file_base=(base)
@wiredump_file_base = base @wiredump_file_base = base
end end
def httpproxy
@httpproxy
end
def httpproxy=(httpproxy) def httpproxy=(httpproxy)
@httpproxy = httpproxy @httpproxy = httpproxy
if @handler @streamhandler.proxy = @httpproxy
@handler.proxy = @httpproxy @streamhandler.reset
@handler.reset
end end
def mandatorycharset
@proxy.mandatorycharset
end
def mandatorycharset=(mandatorycharset)
@proxy.mandatorycharset = mandatorycharset
end end
def default_encodingstyle def default_encodingstyle
@ -126,7 +127,7 @@ public
# #
def invoke(headers, body) def invoke(headers, body)
if @wiredump_file_base if @wiredump_file_base
@handler.wiredump_file_base = @streamhandler.wiredump_file_base =
@wiredump_file_base + '_' << body.elename.name @wiredump_file_base + '_' << body.elename.name
end end
@proxy.invoke(headers, body) @proxy.invoke(headers, body)
@ -136,7 +137,7 @@ public
# Convert parameters: params array => SOAPArray => members array # Convert parameters: params array => SOAPArray => members array
params = Mapping.obj2soap(params, @mapping_registry).to_a params = Mapping.obj2soap(params, @mapping_registry).to_a
if @wiredump_file_base if @wiredump_file_base
@handler.wiredump_file_base = @wiredump_file_base + '_' << name @streamhandler.wiredump_file_base = @wiredump_file_base + '_' << name
end end
# Then, call @proxy.call like the following. # Then, call @proxy.call like the following.
@ -161,7 +162,7 @@ public
end end
def reset_stream def reset_stream
@handler.reset @streamhandler.reset
end end
private private

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - RPC element definition.
SOAP4R - RPC element definition. # Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'soap/baseData' require 'soap/baseData'
@ -180,10 +169,10 @@ class SOAPMethodRequest < SOAPMethod
params.each do |param| params.each do |param|
param_name = "p#{ i }" param_name = "p#{ i }"
i += 1 i += 1
param_def << [IN, nil, param_name] param_def << [IN, param_name, nil]
param_value << [param_name, param] param_value << [param_name, param]
end end
param_def << [RETVAL, nil, 'return'] param_def << [RETVAL, 'return', nil]
o = new(qname, param_def) o = new(qname, param_def)
o.set_param(param_value) o.set_param(param_value)
o o
@ -236,7 +225,7 @@ class SOAPMethodResponse < SOAPMethod
def retval=(retval) def retval=(retval)
@retval = retval @retval = retval
@retval.elename = @retval.elename.dup_name('return') @retval.elename = @retval.elename.dup_name(@retval_name || 'return')
end end
def each def each

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - RPC Proxy library.
SOAP4R - RPC Proxy library. # Copyright (C) 2000, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'soap/soap' require 'soap/soap'
@ -35,13 +24,16 @@ class Proxy
public public
attr_accessor :soapaction 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 attr_reader :method
def initialize(stream_handler, soapaction = nil) def initialize(streamhandler, soapaction = nil)
@handler = stream_handler @streamhandler = streamhandler
@soapaction = soapaction @soapaction = soapaction
@method = {} @method = {}
@mandatorycharset = nil
@allow_unqualified_element = false @allow_unqualified_element = false
@default_encodingstyle = nil @default_encodingstyle = nil
end end
@ -100,13 +92,13 @@ public
end end
opt = create_options opt = create_options
send_string = Processor.marshal(req_header, req_body, opt) 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? if data.receive_string.empty?
return nil, nil return nil, nil
end end
res_charset = StreamHandler.parse_media_type(data.receive_contenttype)
opt = create_options 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) res_header, res_body = Processor.unmarshal(data.receive_string, opt)
return res_header, res_body return res_header, res_body
end end

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - RPC Routing library
SOAP4R - RPC Routing library # Copyright (C) 2001, 2002 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2001, 2002 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'soap/soap' require 'soap/soap'

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - RPC utility.
SOAP4R - RPC utility. # Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
module SOAP module SOAP

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - SOAP handler servlet for WEBrick
SOAP4R - SOAP handler servlet for WEBrick # Copyright (C) 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2001, 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'webrick/httpservlet/abstract' require 'webrick/httpservlet/abstract'

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - WEBrick Server
SOAP4R - WEBrick Server # Copyright (C) 2003 by NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2003 by NAKAMURA, Hiroshi
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'logger' require 'logger'

View File

@ -1,20 +1,9 @@
=begin # soap/soap.rb: SOAP4R - Base definitions.
SOAP4R - Base definitions. # Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/qname' require 'xsd/qname'

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - Stream handler.
SOAP4R - Stream handler. # Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'soap/soap' require 'soap/soap'
@ -73,7 +62,7 @@ class StreamHandler
end end
charset = $1 charset = $1
charset.gsub!(/"/, '') if charset charset.gsub!(/"/, '') if charset
charset charset || 'us-ascii'
end end
def self.create_media_type(charset) def self.create_media_type(charset)
@ -90,6 +79,7 @@ public
attr_accessor :wiredump_dev attr_accessor :wiredump_dev
attr_accessor :wiredump_file_base attr_accessor :wiredump_file_base
attr_accessor :charset attr_accessor :charset
attr_reader :client
NofRetry = 10 # [times] NofRetry = 10 # [times]
ConnectTimeout = 20 # [sec] ConnectTimeout = 20 # [sec]
@ -108,6 +98,10 @@ public
@client.session_manager.receive_timeout = ReceiveTimeout @client.session_manager.receive_timeout = ReceiveTimeout
end end
def inspect
"#<#{self.class}:#{endpoint_url}>"
end
def proxy=(proxy) def proxy=(proxy)
@proxy = proxy @proxy = proxy
@client.proxy = @proxy @client.proxy = @proxy

View File

@ -1,20 +1,9 @@
=begin # SOAP4R - SOAP WSDL driver
SOAP4R - SOAP WSDL driver # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/parser' require 'wsdl/parser'
@ -44,6 +33,10 @@ class WSDLDriverFactory
@wsdl = import(wsdl) @wsdl = import(wsdl)
end end
def inspect
"#<#{self.class}:#{@wsdl.name}>"
end
def create_driver(servicename = nil, portname = nil, opt = {}) def create_driver(servicename = nil, portname = nil, opt = {})
service = if servicename service = if servicename
@wsdl.service(XSD::QName.new(@wsdl.targetnamespace, servicename)) @wsdl.service(XSD::QName.new(@wsdl.targetnamespace, servicename))
@ -105,6 +98,7 @@ class WSDLDriver
__attr_proxy :wiredump_dev, true __attr_proxy :wiredump_dev, true
__attr_proxy :wiredump_file_base, true __attr_proxy :wiredump_file_base, true
__attr_proxy :httpproxy, true __attr_proxy :httpproxy, true
__attr_proxy :mandatorycharset, true # force using charset
__attr_proxy :default_encodingstyle, true __attr_proxy :default_encodingstyle, true
__attr_proxy :allow_unqualified_element, true __attr_proxy :allow_unqualified_element, true
@ -121,14 +115,16 @@ class WSDLDriver
include Logger::Severity include Logger::Severity
include SOAP include SOAP
attr_reader :wsdl
attr_reader :port
attr_reader :opt attr_reader :opt
attr_accessor :logdev attr_accessor :logdev
attr_accessor :mapping_registry attr_accessor :mapping_registry
attr_accessor :wsdl_mapping_registry attr_accessor :wsdl_mapping_registry
attr_reader :endpoint_url
attr_reader :wiredump_dev attr_reader :wiredump_dev
attr_reader :wiredump_file_base attr_reader :wiredump_file_base
attr_reader :httpproxy attr_reader :httpproxy
attr_accessor :mandatorycharset
attr_accessor :default_encodingstyle attr_accessor :default_encodingstyle
attr_accessor :allow_unqualified_element attr_accessor :allow_unqualified_element
@ -220,11 +216,9 @@ class WSDLDriver
@opt = opt.dup @opt = opt.dup
@mapping_registry = nil # for rpc unmarshal @mapping_registry = nil # for rpc unmarshal
@wsdl_mapping_registry = nil # for rpc marshal @wsdl_mapping_registry = nil # for rpc marshal
@endpoint_url = nil
@wiredump_dev = nil @wiredump_dev = nil
@wiredump_file_base = nil @wiredump_file_base = nil
name = 'http_proxy' @mandatorycharset = nil
@httpproxy = ENV[name] || ENV[name.upcase]
@wsdl_elements = @wsdl.collect_elements @wsdl_elements = @wsdl.collect_elements
@wsdl_types = @wsdl.collect_complextypes @wsdl_types = @wsdl.collect_complextypes
@ -235,7 +229,8 @@ class WSDLDriver
@allow_unqualified_element = true @allow_unqualified_element = true
@generate_explicit_type = false @generate_explicit_type = false
create_handler create_streamhandler(@port.soap_address.location,
ENV['http_proxy'] || ENV['HTTP_PROXY'])
@operations = {} @operations = {}
# Convert a map which key is QName, to a Hash which key is String. # Convert a map which key is QName, to a Hash which key is String.
@port.inputoperation_map.each do |op_name, op_info| @port.inputoperation_map.each do |op_name, op_info|
@ -244,21 +239,20 @@ class WSDLDriver
end end
end end
def endpoint_url=(endpoint_url) def endpoint_url
@endpoint_url = endpoint_url @streamhandler.endpoint_url
if @handler
@handler.endpoint_url = @endpoint_url
@handler.reset
end end
log(DEBUG) { "endpoint_url=: set endpoint_url #{ @endpoint_url }." }
def endpoint_url=(endpoint_url)
@streamhandler.endpoint_url = endpoint_url
@streamhandler.reset
log(DEBUG) { "endpoint_url=: set endpoint_url #{ endpoint_url }." }
end end
def wiredump_dev=(dev) def wiredump_dev=(dev)
@wiredump_dev = dev @wiredump_dev = dev
if @handler @streamhandler.wiredump_dev = @wiredump_dev
@handler.wiredump_dev = @wiredump_dev @streamhandler.reset
@handler.reset
end
end end
def wiredump_file_base=(base) def wiredump_file_base=(base)
@ -266,16 +260,13 @@ class WSDLDriver
end end
def httpproxy=(httpproxy) def httpproxy=(httpproxy)
@httpproxy = httpproxy @streamhandler.proxy = httpproxy
if @handler @streamhandler.reset
@handler.proxy = @httpproxy log(DEBUG) { "httpproxy=: set httpproxy #{ httpproxy }." }
@handler.reset
end
log(DEBUG) { "httpproxy=: set httpproxy #{ @httpproxy }." }
end end
def reset_stream def reset_stream
@handler.reset @streamhandler.reset
end end
def rpc_send(method_name, *params) def rpc_send(method_name, *params)
@ -292,7 +283,8 @@ class WSDLDriver
req_body = SOAPBody.new(method) req_body = SOAPBody.new(method)
if @wiredump_file_base if @wiredump_file_base
@handler.wiredump_file_base = @wiredump_file_base + '_' << method_name @streamhandler.wiredump_file_base =
@wiredump_file_base + '_' << method_name
end end
begin begin
@ -338,11 +330,10 @@ class WSDLDriver
private private
def create_handler def create_streamhandler(endpoint_url, httpproxy)
endpoint_url = @endpoint_url || @port.soap_address.location @streamhandler = HTTPPostStreamHandler.new(endpoint_url, httpproxy,
@handler = HTTPPostStreamHandler.new(endpoint_url, @httpproxy,
XSD::Charset.encoding_label) XSD::Charset.encoding_label)
@handler.wiredump_dev = @wiredump_dev @streamhandler.wiredump_dev = @wiredump_dev
end end
def create_method_obj(names, params) def create_method_obj(names, params)
@ -356,13 +347,13 @@ class WSDLDriver
def invoke(req_header, req_body, op_info, opt) def invoke(req_header, req_body, op_info, opt)
send_string = Processor.marshal(req_header, req_body, opt) send_string = Processor.marshal(req_header, req_body, opt)
log(DEBUG) { "invoke: sending string #{ send_string }" } 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 }" } log(DEBUG) { "invoke: received string #{ data.receive_string }" }
if data.receive_string.empty? if data.receive_string.empty?
return nil, nil return nil, nil
end end
res_charset = StreamHandler.parse_media_type(data.receive_contenttype) opt[:charset] = @mandatorycharset ||
opt[:charset] = res_charset StreamHandler.parse_media_type(data.receive_contenttype)
res_header, res_body = Processor.unmarshal(data.receive_string, opt) res_header, res_body = Processor.unmarshal(data.receive_string, opt)
return res_header, res_body return res_header, res_body
end end
@ -483,6 +474,10 @@ class WSDLDriver
def initialize(wsdl, port, logdev, opt) def initialize(wsdl, port, logdev, opt)
@servant = Servant__.new(self, wsdl, port, logdev, opt) @servant = Servant__.new(self, wsdl, port, logdev, opt)
end end
def inspect
"#<#{self.class}:#{@servant.port.name}>"
end
end end

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL binding definition.
WSDL4R - WSDL binding definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL data definitions.
WSDL4R - WSDL data definitions. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/documentation' require 'wsdl/documentation'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL definitions.
WSDL4R - WSDL definitions. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'
@ -53,6 +42,11 @@ class Definitions < Info
@root = self @root = self
end end
def inspect
name = @name || '(unnamed)'
"#<#{self.class}:#{name}>"
end
def targetnamespace=(targetnamespace) def targetnamespace=(targetnamespace)
@targetnamespace = targetnamespace @targetnamespace = targetnamespace
if @name if @name

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL SOAP documentation element.
WSDL4R - WSDL SOAP documentation element. # Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL import definition.
WSDL4R - WSDL import definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,23 +1,13 @@
=begin # WSDL4R - WSDL importer library.
WSDL4R - WSDL importer library. # Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'
require 'wsdl/parser'
module WSDL module WSDL

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL information base.
WSDL4R - WSDL information base. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
module WSDL module WSDL

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL message definition.
WSDL4R - WSDL message definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL operation definition.
WSDL4R - WSDL operation definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'
@ -49,7 +38,7 @@ class Operation < Info
@parameter_order = nil @parameter_order = nil
@input = nil @input = nil
@output = nil @output = nil
@fault = nil @fault = []
end end
def targetnamespace def targetnamespace
@ -76,10 +65,6 @@ class Operation < Info
sort_parts(output.find_message.parts) sort_parts(output.find_message.parts)
end end
def faultparts
sort_parts(fault.find_message.parts)
end
def outputname def outputname
XSD::QName.new(targetnamespace, XSD::QName.new(targetnamespace,
output.name ? output.name.name : @name.name + 'Response') output.name ? output.name.name : @name.name + 'Response')
@ -97,7 +82,7 @@ class Operation < Info
o o
when FaultName when FaultName
o = Param.new o = Param.new
@fault = o @fault << o
o o
when DocumentationName when DocumentationName
o = Documentation.new o = Documentation.new

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL bound operation definition.
WSDL4R - WSDL bound operation definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'
@ -35,7 +24,7 @@ class OperationBinding < Info
@name = nil @name = nil
@input = nil @input = nil
@output = nil @output = nil
@fault = nil @fault = []
@soapoperation = nil @soapoperation = nil
end end
@ -63,7 +52,7 @@ class OperationBinding < Info
o o
when FaultName when FaultName
o = Param.new o = Param.new
@fault = o @fault << o
o o
when SOAPOperationName when SOAPOperationName
o = WSDL::SOAP::Operation.new o = WSDL::SOAP::Operation.new

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL param definition.
WSDL4R - WSDL param definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL XML Instance parser library.
WSDL4R - WSDL XML Instance parser library. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/qname' require 'xsd/qname'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL part definition.
WSDL4R - WSDL part definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL port definition.
WSDL4R - WSDL port definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL portType definition.
WSDL4R - WSDL portType definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL service definition.
WSDL4R - WSDL service definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL SOAP address definition.
WSDL4R - WSDL SOAP address definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL SOAP binding definition.
WSDL4R - WSDL SOAP binding definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL SOAP body definition.
WSDL4R - WSDL SOAP body definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - SOAP complexType definition for WSDL.
WSDL4R - SOAP complexType definition for WSDL. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/xmlSchema/complexType' require 'wsdl/xmlSchema/complexType'
@ -31,7 +20,11 @@ class ComplexType < Info
def check_type def check_type
if content if content
if content.elements.size == 1 and content.elements[0].maxoccurs != 1
:TYPE_ARRAY
else
:TYPE_STRUCT :TYPE_STRUCT
end
elsif complexcontent and complexcontent.base == ::SOAP::ValueArrayName elsif complexcontent and complexcontent.base == ::SOAP::ValueArrayName
:TYPE_ARRAY :TYPE_ARRAY
else else
@ -70,20 +63,26 @@ class ComplexType < Info
end end
def find_arytype def find_arytype
unless compoundtype == :TYPE_ARRAY
raise RuntimeError.new("Assert: not for array")
end
if complexcontent
complexcontent.attributes.each do |attribute| complexcontent.attributes.each do |attribute|
if attribute.ref == ::SOAP::AttrArrayTypeName if attribute.ref == ::SOAP::AttrArrayTypeName
return attribute.arytype return attribute.arytype
end end
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 nil
end end
private private
def content_arytype def content_arytype
unless compoundtype == :TYPE_ARRAY
raise RuntimeError.new("Assert: not for array")
end
arytype = find_arytype arytype = find_arytype
ns = arytype.namespace ns = arytype.namespace
name = arytype.name.sub(/\[(?:,)*\]$/, '') name = arytype.name.sub(/\[(?:,)*\]$/, '')

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL SOAP binding data definitions.
WSDL4R - WSDL SOAP binding data definitions. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/qname' require 'xsd/qname'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL additional definitions for SOAP.
WSDL4R - WSDL additional definitions for SOAP. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL SOAP body definition.
WSDL4R - WSDL SOAP body definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL SOAP body definition.
WSDL4R - WSDL SOAP body definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL SOAP body definition.
WSDL4R - WSDL SOAP body definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL SOAP operation definition.
WSDL4R - WSDL SOAP operation definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL types definition.
WSDL4R - WSDL types definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - Base definitions.
WSDL4R - Base definitions. # Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/qname' require 'xsd/qname'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - XMLSchema complexType definition for WSDL.
WSDL4R - XMLSchema complexType definition for WSDL. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - XMLSchema any definition for WSDL.
WSDL4R - XMLSchema any definition for WSDL. # Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - XMLSchema attribute definition for WSDL.
WSDL4R - XMLSchema attribute definition for WSDL. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - XMLSchema complexType definition for WSDL.
WSDL4R - XMLSchema complexType definition for WSDL. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - XMLSchema complexContent definition for WSDL.
WSDL4R - XMLSchema complexContent definition for WSDL. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - XMLSchema complexType definition for WSDL.
WSDL4R - XMLSchema complexType definition for WSDL. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - XMLSchema complexType definition for WSDL.
WSDL4R - XMLSchema complexType definition for WSDL. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - XMLSchema data definitions.
WSDL4R - XMLSchema data definitions. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/xmlSchema/schema' require 'wsdl/xmlSchema/schema'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - XMLSchema element definition for WSDL.
WSDL4R - XMLSchema element definition for WSDL. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - XMLSchema import definition.
WSDL4R - XMLSchema import definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - WSDL XML Instance parser library.
WSDL4R - WSDL XML Instance parser library. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/qname' require 'xsd/qname'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - XMLSchema schema definition for WSDL.
WSDL4R - XMLSchema schema definition for WSDL. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - XMLSchema complexType definition for WSDL.
WSDL4R - XMLSchema complexType definition for WSDL. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # WSDL4R - XMLSchema unique element.
WSDL4R - XMLSchema unique element. # Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'wsdl/info' require 'wsdl/info'

View File

@ -1,20 +1,9 @@
=begin # XSD4R - Charset handling library.
XSD4R - Charset handling library. # Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
module XSD module XSD
@ -40,15 +29,15 @@ public
@encoding = 'UTF8' @encoding = 'UTF8'
EncodingConvertMap[['UTF8', 'EUC' ]] = Proc.new { |str| IconvCharset.safe_iconv("euc-jp", "utf-8", str) } 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' , '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 if /(mswin|bccwin|mingw|cygwin|emx)/ =~ RUBY_PLATFORM
EncodingConvertMap[['UTF8', 'SJIS']] = Proc.new { |str| IconvCharset.safe_iconv("cp932", "utf-8", str) } 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', 'UTF8']] = Proc.new { |str| IconvCharset.safe_iconv("utf-8", "cp932", str) }
EncodingConvertMap[['SJIS', 'EUC' ]] = Proc.new { |str| IconvCharset.safe_iconv("euc-jp", "cp932", str) } EncodingConvertMap[['SJIS', 'EUC' ]] = Proc.new { |str| IconvCharset.safe_iconv("euc-jp", "cp932", str) }
else else
EncodingConvertMap[['UTF8', 'SJIS']] = Proc.new { |str| IconvCharset.safe_iconv("shift-jis", "utf-8", 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', '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[['SJIS', 'EUC' ]] = Proc.new { |str| IconvCharset.safe_iconv("euc-jp", "shift_jis", str) }
end end
rescue LoadError rescue LoadError
begin begin

View File

@ -1,20 +1,9 @@
=begin # XSD4R - XML Schema Datatype implementation.
XSD4R - XML Schema Datatype implementation. # Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/qname' require 'xsd/qname'

View File

@ -1,20 +1,9 @@
=begin # XSD4R - XML Schema Datatype 1999 support
XSD4R - XML Schema Datatype 1999 support # Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/datatypes' require 'xsd/datatypes'

View File

@ -1,20 +1,9 @@
=begin # XSD4R - Charset handling with iconv.
XSD4R - Charset handling with iconv. # Copyright (C) 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'iconv' require 'iconv'

View File

@ -1,20 +1,9 @@
=begin # XSD4R - WSDL named element collection.
XSD4R - WSDL named element collection. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
module XSD module XSD

View File

@ -1,20 +1,9 @@
=begin # XSD4R - XML Schema Namespace library
XSD4R - XML Schema Namespace library # Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2000, 2001, 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/datatypes' require 'xsd/datatypes'

View File

@ -1,20 +1,9 @@
=begin # XSD4R - XML QName definition.
XSD4R - XML QName definition. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
module XSD module XSD

View File

@ -1,20 +1,9 @@
=begin # XSD4R - XML Instance parser library.
XSD4R - XML Instance parser library. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/xmlparser/parser' require 'xsd/xmlparser/parser'

View File

@ -1,20 +1,9 @@
=begin # XSD4R - XML Instance parser library.
XSD4R - XML Instance parser library. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/qname' require 'xsd/qname'
@ -57,7 +46,7 @@ public
def initialize(host, opt = {}) def initialize(host, opt = {})
@host = host @host = host
@charset = opt[:charset] || 'us-ascii' @charset = opt[:charset] || nil
end end
def parse(string_or_readable) def parse(string_or_readable)

View File

@ -1,20 +1,9 @@
=begin # XSD4R - REXMLParser XML parser library.
XSD4R - REXMLParser XML parser library. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/xmlparser' require 'xsd/xmlparser'

View File

@ -1,20 +1,9 @@
=begin # XSD4R - XMLParser XML parser library.
XSD4R - XMLParser XML parser library. # Copyright (C) 2001, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2001, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/xmlparser' require 'xsd/xmlparser'

View File

@ -1,20 +1,9 @@
=begin # XSD4R - XMLScan XML parser library.
XSD4R - XMLScan XML parser library. # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
This program is free software; you can redistribute it and/or modify it under # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
the terms of the GNU General Public License as published by the Free Software # redistribute it and/or modify it under the same terms of Ruby's license;
Foundation; either version 2 of the License, or (at your option) any later # either the dual license version in 2003, or any later version.
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
require 'xsd/xmlparser' require 'xsd/xmlparser'

View File

@ -27,7 +27,7 @@ File.open("digraph_marshalled_string.soap", "wb") do |f|
SOAP::Marshal.dump(n1, f) SOAP::Marshal.dump(n1, f)
end end
marshalledString = File.open("digraph_marshalled_string.soap").read marshalledString = File.open("digraph_marshalled_string.soap") { |f| f.read }
puts marshalledString puts marshalledString

View File

@ -30,7 +30,7 @@ end
=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. # 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 devtag = nil
# v2: AMAZON_WSDL = 'http://soap.amazon.com/schemas2/AmazonWebServices.wsdl' # v2: AMAZON_WSDL = 'http://soap.amazon.com/schemas2/AmazonWebServices.wsdl'

View File

@ -37,7 +37,7 @@ obj = GoogleSearchPort.new(endpoint_url)
# N/A # N/A
# #
key = q = start = maxResults = filter = restrict = safeSearch = lr = ie = oe = nil 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" q = "Ruby"
start = 0 start = 0
maxResults = 10 maxResults = 10

View File

@ -3,7 +3,7 @@ require 'soap/wsdlDriver'
word = ARGV.shift word = ARGV.shift
# You must get key from http://www.google.com/apis/ to use Google Web APIs. # 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 = 'http://api.google.com/GoogleSearch.wsdl'
# GOOGLE_WSDL = 'GoogleSearch.wsdl' # GOOGLE_WSDL = 'GoogleSearch.wsdl'

View File

@ -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>

View File

@ -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

View File

@ -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

View File

@ -1,77 +1,31 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<definitions <definitions name = "emptycomplextype"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="urn:jp.gr.jin.rrr.example.emptycomplextype"
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"
xmlns="http://schemas.xmlsoap.org/wsdl/"> xmlns="http://schemas.xmlsoap.org/wsdl/">
<types> <types>
<s:schema <xsd:schema elementFormDefault="qualified"
elementFormDefault="qualified" targetNamespace="urn:jp.gr.jin.rrr.example.emptycomplextype">
targetNamespace="http://www.winfessor.com/SoapBoxWebService/SoapBoxWebService"> <xsd:element name="typeIn">
<s:element name="typeIn"> <xsd:complexType />
<s:complexType /> </xsd:element>
</s:element>
<s:element name="typeOut"> <xsd:element name="typeOut">
<s:complexType> <xsd:complexType>
<s:sequence> <xsd:sequence>
<s:element minOccurs="0" maxOccurs="1" name="str1" type="s:string" /> <xsd:element minOccurs="0" maxOccurs="1" name="str1" type="xsd:string" />
<s:element minOccurs="0" maxOccurs="1" name="str2" type="s:string" /> <xsd:element minOccurs="0" maxOccurs="1" name="str2" type="xsd:string" />
<s:element minOccurs="0" maxOccurs="1" name="seq"> <xsd:element minOccurs="0" maxOccurs="1" name="seq">
<s:complexType> <xsd:complexType>
<s:sequence> <xsd:sequence>
<s:any /> <xsd:any />
</s:sequence> </xsd:sequence>
</s:complexType> </xsd:complexType>
</s:element> </xsd:element>
</s:sequence> </xsd:sequence>
</s:complexType> </xsd:complexType>
</s:element> </xsd:element>
</s:schema> </xsd:schema>
</types> </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> </definitions>

View File

@ -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>

View File

@ -6,16 +6,16 @@ module WSDL
class TestWSDL < Test::Unit::TestCase class TestWSDL < Test::Unit::TestCase
def self.setup(filename) def setup
@@filename = filename @file = File.join(File.dirname(__FILE__), 'emptycomplextype.wsdl')
end end
def test_wsdl 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
end end
TestWSDL.setup(File.join(File.dirname(__FILE__), 'emptycomplextype.wsdl'))
end end

View File

@ -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

View File

@ -6,16 +6,17 @@ module XSD
class TestXMLSchemaParser < Test::Unit::TestCase class TestXMLSchemaParser < Test::Unit::TestCase
def self.setup(filename) def setup
@@filename = filename @file = File.join(File.dirname(__FILE__), 'xmlschema.xml')
end end
def test_wsdl 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
end end
TestXMLSchemaParser.setup(File.join(File.dirname(__FILE__), 'xmlschema.xml'))
end end

View File

@ -1,11 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<xs:schema <xs:schema
xmlns:mstns="http://www.winfessor.com/SoapBoxWebService/MessageDataSet.xsd"
xmlns="http://www.winfessor.com/SoapBoxWebService/MessageDataSet.xsd"
attributeFormDefault="qualified" attributeFormDefault="qualified"
elementFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://www.winfessor.com/SoapBoxWebService/MessageDataSet.xsd" targetNamespace="urn:jp.gr.jin.rrr.example.fakeschema"
id="MessageDataSet"
xmlns:xs="http://www.w3.org/2001/XMLSchema"> xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="MessageDataSet"> <xs:element name="MessageDataSet">
<xs:complexType> <xs:complexType>