summaryrefslogtreecommitdiff
path: root/lib/wsdl/soap
diff options
context:
space:
mode:
authornahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-24 15:18:44 +0000
committernahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-24 15:18:44 +0000
commitdb9445103c082a306ba085f7677da02ea94b8841 (patch)
treea311d59f031ae5def87f68be71ed1f58abadc031 /lib/wsdl/soap
parent8c2fb77787d1f20b4c19c9c52552856c339b86e9 (diff)
* lib/soap/* (29 files): SOAP4R added.
* lib/wsdl/* (42 files): WSDL4R added. * lib/xsd/* (12 files): XSD4R added. * test/soap/* (16 files): added. * test/wsdl/* (2 files): added. * test/xsd/* (3 files): added. * sample/soap/* (27 files): added. * sample/wsdl/* (13 files): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/wsdl/soap')
-rw-r--r--lib/wsdl/soap/address.rb51
-rw-r--r--lib/wsdl/soap/binding.rb59
-rw-r--r--lib/wsdl/soap/body.rb63
-rw-r--r--lib/wsdl/soap/complexType.rb96
-rw-r--r--lib/wsdl/soap/data.rb52
-rw-r--r--lib/wsdl/soap/definitions.rb130
-rw-r--r--lib/wsdl/soap/fault.rb63
-rw-r--r--lib/wsdl/soap/header.rb90
-rw-r--r--lib/wsdl/soap/headerfault.rb67
-rw-r--r--lib/wsdl/soap/operation.rb131
10 files changed, 802 insertions, 0 deletions
diff --git a/lib/wsdl/soap/address.rb b/lib/wsdl/soap/address.rb
new file mode 100644
index 0000000000..759918c95b
--- /dev/null
+++ b/lib/wsdl/soap/address.rb
@@ -0,0 +1,51 @@
+=begin
+WSDL4R - WSDL SOAP address definition.
+Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PRATICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 675 Mass
+Ave, Cambridge, MA 02139, USA.
+=end
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module SOAP
+
+
+class Address < Info
+ attr_reader :location
+
+ def initialize
+ super
+ @location = nil
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when LocationAttrName
+ @location = value
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/binding.rb b/lib/wsdl/soap/binding.rb
new file mode 100644
index 0000000000..e9ba3a48d1
--- /dev/null
+++ b/lib/wsdl/soap/binding.rb
@@ -0,0 +1,59 @@
+=begin
+WSDL4R - WSDL SOAP binding definition.
+Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PRATICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 675 Mass
+Ave, Cambridge, MA 02139, USA.
+=end
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module SOAP
+
+
+class Binding < Info
+ attr_reader :style
+ attr_reader :transport
+
+ def initialize
+ super
+ @style = nil
+ @transport = nil
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when StyleAttrName
+ if ["document", "rpc"].include?(value)
+ @style = value.intern
+ else
+ raise AttributeConstraintError.new("Unexpected value #{ value }.")
+ end
+ when TransportAttrName
+ @transport = value
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/body.rb b/lib/wsdl/soap/body.rb
new file mode 100644
index 0000000000..f209622410
--- /dev/null
+++ b/lib/wsdl/soap/body.rb
@@ -0,0 +1,63 @@
+=begin
+WSDL4R - WSDL SOAP body definition.
+Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PRATICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 675 Mass
+Ave, Cambridge, MA 02139, USA.
+=end
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module SOAP
+
+
+class Body < Info
+ attr_reader :parts
+ attr_reader :use # required
+ attr_reader :encodingstyle
+ attr_reader :namespace
+
+ def initialize
+ super
+ @parts = nil
+ @use = nil
+ @encodingstyle = nil
+ @namespace = nil
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when PartsAttrName
+ @parts = value
+ when UseAttrName
+ @use = value
+ when EncodingStyleAttrName
+ @encodingstyle = value
+ when NamespaceAttrName
+ @namespace = value
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/complexType.rb b/lib/wsdl/soap/complexType.rb
new file mode 100644
index 0000000000..f47ddee449
--- /dev/null
+++ b/lib/wsdl/soap/complexType.rb
@@ -0,0 +1,96 @@
+=begin
+WSDL4R - SOAP complexType definition for WSDL.
+Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PRATICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 675 Mass
+Ave, Cambridge, MA 02139, USA.
+=end
+
+
+require 'wsdl/xmlSchema/complexType'
+
+
+module WSDL
+module XMLSchema
+
+
+class ComplexType < Info
+ def compoundtype
+ @compoundtype ||= check_type
+ end
+
+ def check_type
+ if content
+ :TYPE_STRUCT
+ elsif complexcontent and complexcontent.base == ::SOAP::ValueArrayName
+ :TYPE_ARRAY
+ else
+ raise NotImplementedError.new("Unknown kind of complexType.")
+ end
+ end
+
+ def child_type(name = nil)
+ case compoundtype
+ when :TYPE_STRUCT
+ if ele = find_element(name)
+ ele.type
+ elsif ele = find_element_by_name(name.name)
+ ele.type
+ else
+ nil
+ end
+ when :TYPE_ARRAY
+ @contenttype ||= content_arytype
+ end
+ end
+
+ def child_defined_complextype(name)
+ unless compoundtype == :TYPE_STRUCT
+ raise RuntimeError.new("Assert: not for struct")
+ end
+ unless ele = find_element(name)
+ if name.namespace.nil?
+ ele = find_element_by_name(name.name)
+ end
+ end
+ unless ele
+ raise RuntimeError.new("Cannot find #{name} as a children of #{@name}.")
+ end
+ ele.local_complextype
+ end
+
+ def find_arytype
+ complexcontent.attributes.each do |attribute|
+ if attribute.ref == ::SOAP::AttrArrayTypeName
+ return attribute.arytype
+ end
+ end
+ nil
+ end
+
+private
+
+ def content_arytype
+ unless compoundtype == :TYPE_ARRAY
+ raise RuntimeError.new("Assert: not for array")
+ end
+ arytype = find_arytype
+ ns = arytype.namespace
+ name = arytype.name.sub(/\[(?:,)*\]$/, '')
+ XSD::QName.new(ns, name)
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/data.rb b/lib/wsdl/soap/data.rb
new file mode 100644
index 0000000000..301ae9951d
--- /dev/null
+++ b/lib/wsdl/soap/data.rb
@@ -0,0 +1,52 @@
+=begin
+WSDL4R - WSDL SOAP binding data definitions.
+Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PRATICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 675 Mass
+Ave, Cambridge, MA 02139, USA.
+=end
+
+
+require 'xsd/qname'
+require 'wsdl/soap/definitions'
+require 'wsdl/soap/binding'
+require 'wsdl/soap/operation'
+require 'wsdl/soap/body'
+require 'wsdl/soap/header'
+require 'wsdl/soap/headerfault'
+require 'wsdl/soap/fault'
+require 'wsdl/soap/address'
+require 'wsdl/soap/complexType'
+
+
+module WSDL
+module SOAP
+
+
+HeaderFaultName = XSD::QName.new(SOAPBindingNamespace, 'headerfault')
+
+LocationAttrName = XSD::QName.new(nil, 'location')
+StyleAttrName = XSD::QName.new(nil, 'style')
+TransportAttrName = XSD::QName.new(nil, 'transport')
+UseAttrName = XSD::QName.new(nil, 'use')
+PartsAttrName = XSD::QName.new(nil, 'parts')
+PartAttrName = XSD::QName.new(nil, 'part')
+NameAttrName = XSD::QName.new(nil, 'name')
+MessageAttrName = XSD::QName.new(nil, 'message')
+EncodingStyleAttrName = XSD::QName.new(nil, 'encodingStyle')
+NamespaceAttrName = XSD::QName.new(nil, 'namespace')
+SOAPActionAttrName = XSD::QName.new(nil, 'soapAction')
+
+
+end
+end
diff --git a/lib/wsdl/soap/definitions.rb b/lib/wsdl/soap/definitions.rb
new file mode 100644
index 0000000000..08df0dcc68
--- /dev/null
+++ b/lib/wsdl/soap/definitions.rb
@@ -0,0 +1,130 @@
+=begin
+WSDL4R - WSDL additional definitions for SOAP.
+Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+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 'xsd/namedelements'
+require 'soap/mapping'
+
+
+module WSDL
+
+
+class Definitions < Info
+ def soap_rpc_complextypes(binding)
+ types = rpc_operation_complextypes(binding)
+ types << array_complextype
+ types << fault_complextype
+ types << exception_complextype
+ types
+ end
+
+private
+
+ def rpc_operation_complextypes(binding)
+ types = XSD::NamedElements.new
+ binding.operations.each do |op_bind|
+ if op_bind_rpc?(op_bind)
+ operation = op_bind.find_operation
+ if op_bind.input
+ type = XMLSchema::ComplexType.new(operation_input_name(operation))
+ message = messages[operation.input.message]
+ type.sequence_elements = elements_from_message(message)
+ types << type
+ end
+ if op_bind.output
+ type = XMLSchema::ComplexType.new(operation_output_name(operation))
+ message = messages[operation.output.message]
+ type.sequence_elements = elements_from_message(message)
+ types << type
+ end
+ end
+ end
+ types
+ end
+
+ def operation_input_name(operation)
+ operation.input.name || operation.name
+ end
+
+ def operation_output_name(operation)
+ operation.output.name ||
+ XSD::QName.new(operation.name.namespace, operation.name.name + "Response")
+ end
+
+ def op_bind_rpc?(op_bind)
+ op_bind.soapoperation and op_bind.soapoperation.operation_style == :rpc
+ end
+
+ def elements_from_message(message)
+ message.parts.collect { |part|
+ qname = XSD::QName.new(nil, part.name)
+ XMLSchema::Element.new(qname, part.type)
+ }
+ end
+
+ def array_complextype
+ type = XMLSchema::ComplexType.new(::SOAP::ValueArrayName)
+ type.complexcontent = XMLSchema::ComplexContent.new
+ type.complexcontent.base = ::SOAP::ValueArrayName
+ attr = XMLSchema::Attribute.new
+ attr.ref = ::SOAP::AttrArrayTypeName
+ anytype = XSD::AnyTypeName.dup
+ anytype.name += '[]'
+ attr.arytype = anytype
+ type.complexcontent.attributes << attr
+ type
+ end
+
+=begin
+<xs:complexType name="Fault" final="extension">
+ <xs:sequence>
+ <xs:element name="faultcode" type="xs:QName" />
+ <xs:element name="faultstring" type="xs:string" />
+ <xs:element name="faultactor" type="xs:anyURI" minOccurs="0" />
+ <xs:element name="detail" type="tns:detail" minOccurs="0" />
+ </xs:sequence>
+</xs:complexType>
+=end
+ def fault_complextype
+ type = XMLSchema::ComplexType.new(::SOAP::EleFaultName)
+ faultcode = XMLSchema::Element.new(::SOAP::EleFaultCodeName, XSD::XSDQName::Type)
+ faultstring = XMLSchema::Element.new(::SOAP::EleFaultStringName, XSD::XSDString::Type)
+ faultactor = XMLSchema::Element.new(::SOAP::EleFaultActorName, XSD::XSDAnyURI::Type)
+ faultactor.minoccurs = 0
+ detail = XMLSchema::Element.new(::SOAP::EleFaultDetailName, XSD::AnyTypeName)
+ detail.minoccurs = 0
+ type.all_elements = [faultcode, faultstring, faultactor, detail]
+ type.final = 'extension'
+ type
+ end
+
+ def exception_complextype
+ type = XMLSchema::ComplexType.new(XSD::QName.new(
+ ::SOAP::Mapping::RubyCustomTypeNamespace, 'SOAPException'))
+ excn_name = XMLSchema::Element.new(XSD::QName.new(nil, 'exceptionTypeName'), XSD::XSDString::Type)
+ cause = XMLSchema::Element.new(XSD::QName.new(nil, 'cause'), XSD::AnyTypeName)
+ backtrace = XMLSchema::Element.new(XSD::QName.new(nil, 'backtrace'), ::SOAP::ValueArrayName)
+ message = XMLSchema::Element.new(XSD::QName.new(nil, 'message'), XSD::XSDString::Type)
+ type.all_elements = [excn_name, cause, backtrace, message]
+ type
+ end
+end
+
+
+end
diff --git a/lib/wsdl/soap/fault.rb b/lib/wsdl/soap/fault.rb
new file mode 100644
index 0000000000..eb57cb0233
--- /dev/null
+++ b/lib/wsdl/soap/fault.rb
@@ -0,0 +1,63 @@
+=begin
+WSDL4R - WSDL SOAP body definition.
+Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PRATICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 675 Mass
+Ave, Cambridge, MA 02139, USA.
+=end
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module SOAP
+
+
+class Fault < Info
+ attr_reader :name # required
+ attr_reader :use # required
+ attr_reader :encodingstyle
+ attr_reader :namespace
+
+ def initialize
+ super
+ @name = nil
+ @use = nil
+ @encodingstyle = nil
+ @namespace = nil
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when NameAttrName
+ @name = value
+ when UseAttrName
+ @use = value
+ when EncodingStyleAttrName
+ @encodingstyle = value
+ when NamespaceAttrName
+ @namespace = value
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/header.rb b/lib/wsdl/soap/header.rb
new file mode 100644
index 0000000000..f779ba5c08
--- /dev/null
+++ b/lib/wsdl/soap/header.rb
@@ -0,0 +1,90 @@
+=begin
+WSDL4R - WSDL SOAP body definition.
+Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PRATICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 675 Mass
+Ave, Cambridge, MA 02139, USA.
+=end
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module SOAP
+
+
+class Header < Info
+ attr_reader :headerfault
+
+ attr_reader :message # required
+ attr_reader :part # required
+ attr_reader :use # required
+ attr_reader :encodingstyle
+ attr_reader :namespace
+
+ def initialize
+ super
+ @message = nil
+ @part = nil
+ @use = nil
+ @encodingstyle = nil
+ @namespace = nil
+ @headerfault = nil
+ end
+
+ def find_message
+ root.message(@message)
+ end
+
+ def find_part
+ find_message.parts.each do |part|
+ if part.name == @part
+ return part
+ end
+ end
+ nil
+ end
+
+ def parse_element(element)
+ case element
+ when HeaderFaultName
+ o = WSDL::SOAP::HeaderFault.new
+ @headerfault = o
+ o
+ else
+ nil
+ end
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when MessageAttrName
+ @message = value
+ when PartAttrName
+ @part = value
+ when UseAttrName
+ @use = value
+ when EncodingStyleAttrName
+ @encodingstyle = value
+ when NamespaceAttrName
+ @namespace = value
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/headerfault.rb b/lib/wsdl/soap/headerfault.rb
new file mode 100644
index 0000000000..c0d58e2230
--- /dev/null
+++ b/lib/wsdl/soap/headerfault.rb
@@ -0,0 +1,67 @@
+=begin
+WSDL4R - WSDL SOAP body definition.
+Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PRATICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 675 Mass
+Ave, Cambridge, MA 02139, USA.
+=end
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module SOAP
+
+
+class HeaderFault < Info
+ attr_reader :message # required
+ attr_reader :part # required
+ attr_reader :use # required
+ attr_reader :encodingstyle
+ attr_reader :namespace
+
+ def initialize
+ super
+ @message = nil
+ @part = nil
+ @use = nil
+ @encodingstyle = nil
+ @namespace = nil
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when MessageAttrName
+ @message = value
+ when PartAttrName
+ @part = value
+ when UseAttrName
+ @use = value
+ when EncodingStyleAttrName
+ @encodingstyle = value
+ when NamespaceAttrName
+ @namespace = value
+ else
+ nil
+ end
+ end
+end
+
+
+end
+end
diff --git a/lib/wsdl/soap/operation.rb b/lib/wsdl/soap/operation.rb
new file mode 100644
index 0000000000..2e88522f5c
--- /dev/null
+++ b/lib/wsdl/soap/operation.rb
@@ -0,0 +1,131 @@
+=begin
+WSDL4R - WSDL SOAP operation definition.
+Copyright (C) 2002, 2003 NAKAMURA, Hiroshi.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PRATICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 675 Mass
+Ave, Cambridge, MA 02139, USA.
+=end
+
+
+require 'wsdl/info'
+
+
+module WSDL
+module SOAP
+
+
+class Operation < Info
+ class OperationInfo
+ attr_reader :style
+ attr_reader :op_name
+ attr_reader :optype_name
+ attr_reader :headerparts
+ attr_reader :bodyparts
+ attr_reader :faultpart
+ attr_reader :soapaction
+
+ def initialize(style, op_name, optype_name, headerparts, bodyparts, faultpart, soapaction)
+ @style = style
+ @op_name = op_name
+ @optype_name = optype_name
+ @headerparts = headerparts
+ @bodyparts = bodyparts
+ @faultpart = faultpart
+ @soapaction = soapaction
+ end
+ end
+
+ attr_reader :soapaction
+ attr_reader :style
+
+ def initialize
+ super
+ @soapaction = nil
+ @style = nil
+ end
+
+ def parse_element(element)
+ nil
+ end
+
+ def parse_attr(attr, value)
+ case attr
+ when StyleAttrName
+ if ["document", "rpc"].include?(value)
+ @style = value.intern
+ else
+ raise AttributeConstraintError.new("Unexpected value #{ value }.")
+ end
+ when SOAPActionAttrName
+ @soapaction = value
+ else
+ nil
+ end
+ end
+
+ def input_info
+ name_info = parent.find_operation.input_info
+ param_info(name_info, parent.input)
+ end
+
+ def output_info
+ name_info = parent.find_operation.output_info
+ param_info(name_info, parent.output)
+ end
+
+ def operation_style
+ return @style if @style
+ if parent_binding.soapbinding
+ return parent_binding.soapbinding.style
+ end
+ nil
+ end
+
+private
+
+ def parent_binding
+ parent.parent
+ end
+
+ def param_info(name_info, param)
+ op_name = name_info.op_name
+ optype_name = name_info.optype_name
+
+ soapheader = param.soapheader
+ headerparts = soapheader.collect { |item| item.find_part }
+
+ soapbody = param.soapbody
+ if soapbody.encodingstyle and
+ soapbody.encodingstyle != ::SOAP::EncodingNamespace
+ raise NotImplementedError.new(
+ "EncodingStyle '#{ soapbody.encodingstyle }' not supported.")
+ end
+ if soapbody.namespace
+ op_name = op_name.dup
+ op_name.namespace = soapbody.namespace
+ end
+ if soapbody.parts
+ raise NotImplementedError.new("soap:body parts")
+ else
+ bodyparts = name_info.parts
+ end
+
+ faultpart = nil
+ soapaction = parent.soapoperation.soapaction
+ OperationInfo.new(operation_style, op_name, optype_name, headerparts, bodyparts, faultpart, soapaction)
+ end
+end
+
+
+end
+end