1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* added files

* lib/soap/attachment.rb
          * lib/soap/header
          * lib/soap/mimemessage.rb
          * lib/soap/rpc/httpserver.rb
          * lib/wsdl/soap/cgiStubCreator.rb
          * lib/wsdl/soap/classDefCreator.rb
          * lib/wsdl/soap/classDefCreatorSupport.rb
          * lib/wsdl/soap/clientSkeltonCreator.rb
          * lib/wsdl/soap/driverCreator.rb
          * lib/wsdl/soap/mappingRegistryCreator.rb
          * lib/wsdl/soap/methodDefCreator.rb
          * lib/wsdl/soap/servantSkeltonCreator.rb
          * lib/wsdl/soap/standaloneServerStubCreator.rb
          * lib/wsdl/xmlSchema/enumeration.rb
          * lib/wsdl/xmlSchema/simpleRestriction.rb
          * lib/wsdl/xmlSchema/simpleType.rb
          * lib/xsd/codegen
          * lib/xsd/codegen.rb
          * sample/soap/authheader
          * sample/soap/raa2.4
          * sample/soap/ssl
          * sample/soap/swa
          * sample/soap/whois.rb
          * sample/soap/calc/samplehttpd.conf
          * sample/soap/exchange/samplehttpd.conf
          * sample/soap/sampleStruct/samplehttpd.conf
          * sample/wsdl/raa2.4
          * sample/wsdl/googleSearch/samplehttpd.conf
          * test/openssl/_test_ssl.rb
          * test/soap/header
          * test/soap/ssl
          * test/soap/struct
          * test/soap/swa
          * test/soap/wsdlDriver
          * test/wsdl/multiplefault.wsdl
          * test/wsdl/simpletype
          * test/wsdl/test_multiplefault.rb

        * modified files
          * lib/soap/baseData.rb
          * lib/soap/element.rb
          * lib/soap/generator.rb
          * lib/soap/marshal.rb
          * lib/soap/netHttpClient.rb
          * lib/soap/parser.rb
          * lib/soap/processor.rb
          * lib/soap/property.rb
          * lib/soap/soap.rb
          * lib/soap/streamHandler.rb
          * lib/soap/wsdlDriver.rb
          * lib/soap/encodingstyle/handler.rb
          * lib/soap/encodingstyle/literalHandler.rb
          * lib/soap/encodingstyle/soapHandler.rb
          * lib/soap/mapping/factory.rb
          * lib/soap/mapping/mapping.rb
          * lib/soap/mapping/registry.rb
          * lib/soap/mapping/rubytypeFactory.rb
          * lib/soap/mapping/wsdlRegistry.rb
          * lib/soap/rpc/cgistub.rb
          * lib/soap/rpc/driver.rb
          * lib/soap/rpc/element.rb
          * lib/soap/rpc/proxy.rb
          * lib/soap/rpc/router.rb
          * lib/soap/rpc/soaplet.rb
          * lib/soap/rpc/standaloneServer.rb
          * lib/wsdl/data.rb
          * lib/wsdl/definitions.rb
          * lib/wsdl/operation.rb
          * lib/wsdl/parser.rb
          * lib/wsdl/soap/definitions.rb
          * lib/wsdl/xmlSchema/complexContent.rb
          * lib/wsdl/xmlSchema/complexType.rb
          * lib/wsdl/xmlSchema/data.rb
          * lib/wsdl/xmlSchema/parser.rb
          * lib/wsdl/xmlSchema/schema.rb
          * lib/xsd/datatypes.rb
          * lib/xsd/qname.rb
          * sample/soap/calc/httpd.rb
          * sample/soap/exchange/httpd.rb
          * sample/soap/sampleStruct/httpd.rb
          * sample/soap/sampleStruct/server.rb
          * sample/wsdl/amazon/AmazonSearch.rb
          * sample/wsdl/amazon/AmazonSearchDriver.rb
          * sample/wsdl/googleSearch/httpd.rb
          * test/soap/test_basetype.rb
          * test/soap/test_property.rb
          * test/soap/test_streamhandler.rb
          * test/soap/calc/test_calc.rb
          * test/soap/calc/test_calc2.rb
          * test/soap/calc/test_calc_cgi.rb
          * test/soap/helloworld/test_helloworld.rb
          * test/wsdl/test_emptycomplextype.rb
          * test/wsdl/axisArray/test_axisarray.rb
          * test/wsdl/datetime/test_datetime.rb
          * test/wsdl/raa/test_raa.rb
          * test/xsd/test_xmlschemaparser.rb
          * test/xsd/test_xsd.rb

        * summary
          * add SOAP Header mustUnderstand support.

          * add HTTP client SSL configuration and Cookies support (works
            completely with http-access2).

          * add header handler for handling sending/receiving SOAP Header.

          * map Ruby's anonymous Struct to common SOAP Struct in SOAP Object
            Model.  it caused error.

          * add WSDL simpleType support to restrict lexical value space.

          * add SOAP with Attachment support.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nahi 2004-07-03 15:29:32 +00:00
parent df2066555d
commit ab31bf0d4d
60 changed files with 2262 additions and 3170 deletions

View file

@ -6,6 +6,7 @@
# either the dual license version in 2003, or any later version.
require 'xsd/qname'
require 'wsdl/documentation'
require 'wsdl/definitions'
require 'wsdl/types'

View file

@ -43,8 +43,7 @@ class Definitions < Info
end
def inspect
name = @name || '(unnamed)'
"#<#{self.class}:#{name}>"
sprintf("#<%s:0x%x %s>", self.class.name, __id__, @name || '(unnamed)')
end
def targetnamespace=(targetnamespace)
@ -58,7 +57,7 @@ class Definitions < Info
result = XSD::NamedElements.new
if @types
@types.schemas.each do |schema|
result.concat(schema.elements)
result.concat(schema.collect_elements)
end
end
@imports.each do |import|
@ -71,7 +70,7 @@ class Definitions < Info
result = @anontypes.dup
if @types
@types.schemas.each do |schema|
result.concat(schema.complextypes)
result.concat(schema.collect_complextypes)
end
end
@imports.each do |import|
@ -80,6 +79,20 @@ class Definitions < Info
result
end
def collect_simpletypes
result = XSD::NamedElements.new
if @types
@types.schemas.each do |schema|
result.concat(schema.collect_simpletypes)
end
end
@imports.each do |import|
result.concat(import.content.collect_simpletypes)
end
result
end
# ToDo: simpletype must be accepted...
def add_type(complextype)
@anontypes << complextype
end

View file

@ -119,7 +119,7 @@ private
return parts.dup
end
if parts.length != result.length
raise RuntimeError.new("Incomplete parameter order list.")
raise RuntimeError.new("Incomplete prarmeterOrder list.")
end
result
end

View file

@ -119,7 +119,8 @@ private
STDERR.puts("Unknown element #{ element }.")
o = Documentation.new # which accepts any element.
end
o.parent = parent
# node could be a pseudo element. pseudo element has its own parent.
o.parent = parent if o.parent.nil?
end
attrs.each do |key, value|
attr = unless /:/ =~ key

View file

@ -75,8 +75,36 @@ class Definitions < Info
types + self.class.soap_rpc_complextypes
end
def collect_faulttypes
result = []
collect_fault_messages.each do |message|
parts = message(message).parts
if parts.size != 1
raise RuntimeError.new("Expecting fault message to have only 1 part.")
end
if result.index(parts[0].type).nil?
result << parts[0].type
end
end
result
end
private
def collect_fault_messages
result = []
porttypes.each do |porttype|
porttype.operations.each do |operation|
operation.fault.each do |fault|
if result.index(fault.message).nil?
result << fault.message
end
end
end
end
result
end
def rpc_operation_complextypes(binding)
types = XSD::NamedElements.new
binding.operations.each do |op_bind|

View file

@ -28,6 +28,10 @@ class ComplexContent < Info
@attributes = XSD::NamedElements.new
end
def targetnamespace
parent.targetnamespace
end
def parse_element(element)
case element
when RestrictionName, ExtensionName

View file

@ -8,6 +8,7 @@
require 'wsdl/info'
require 'wsdl/xmlSchema/content'
require 'wsdl/xmlSchema/element'
require 'xsd/namedelements'
@ -36,11 +37,16 @@ class ComplexType < Info
def targetnamespace
parent.targetnamespace
end
AnyAsElement = Element.new(XSD::QName.new(nil, 'any'), XSD::AnyTypeName)
def each_element
if @content
@content.elements.each do |element|
yield(element.name, element)
if element.is_a?(Any)
yield(AnyAsElement)
else
yield(element)
end
end
end
end
@ -48,7 +54,11 @@ class ComplexType < Info
def find_element(name)
if @content
@content.elements.each do |element|
return element if name == element.name
if element.is_a?(Any)
return AnyAsElement if name == AnyAsElement.name
else
return element if name == element.name
end
end
end
nil
@ -57,7 +67,11 @@ class ComplexType < Info
def find_element_by_name(name)
if @content
@content.elements.each do |element|
return element if name == element.name.name
if element.is_a?(Any)
return AnyAsElement if name == AnyAsElement.name.name
else
return element if name == element.name.name
end
end
end
nil

View file

@ -6,8 +6,11 @@
# either the dual license version in 2003, or any later version.
require 'xsd/datatypes'
require 'wsdl/xmlSchema/schema'
require 'wsdl/xmlSchema/import'
require 'wsdl/xmlSchema/simpleType'
require 'wsdl/xmlSchema/simpleRestriction'
require 'wsdl/xmlSchema/complexType'
require 'wsdl/xmlSchema/complexContent'
require 'wsdl/xmlSchema/any'
@ -17,7 +20,7 @@ require 'wsdl/xmlSchema/choice'
require 'wsdl/xmlSchema/sequence'
require 'wsdl/xmlSchema/attribute'
require 'wsdl/xmlSchema/unique'
require 'wsdl/xmlSchema/enumeration'
module WSDL
module XMLSchema
@ -30,6 +33,7 @@ ChoiceName = XSD::QName.new(XSD::Namespace, 'choice')
ComplexContentName = XSD::QName.new(XSD::Namespace, 'complexContent')
ComplexTypeName = XSD::QName.new(XSD::Namespace, 'complexType')
ElementName = XSD::QName.new(XSD::Namespace, 'element')
EnumerationName = XSD::QName.new(XSD::Namespace, 'enumeration')
ExtensionName = XSD::QName.new(XSD::Namespace, 'extension')
ImportName = XSD::QName.new(XSD::Namespace, 'import')
RestrictionName = XSD::QName.new(XSD::Namespace, 'restriction')
@ -57,6 +61,7 @@ SchemaLocationAttrName = XSD::QName.new(nil, 'schemaLocation')
TargetNamespaceAttrName = XSD::QName.new(nil, 'targetNamespace')
TypeAttrName = XSD::QName.new(nil, 'type')
UseAttrName = XSD::QName.new(nil, 'use')
ValueAttrName = XSD::QName.new(nil, 'value')
end

View file

@ -116,7 +116,8 @@ private
unless o
raise UnknownElementError.new("Unknown element #{ element }.")
end
o.parent = parent
# node could be a pseudo element. pseudo element has its own parent.
o.parent = parent if o.parent.nil?
end
attrs.each do |key, value|
attr = unless /:/ =~ key

View file

@ -17,6 +17,7 @@ module XMLSchema
class Schema < Info
attr_reader :targetnamespace # required
attr_reader :complextypes
attr_reader :simpletypes
attr_reader :elements
attr_reader :attributes
attr_reader :imports
@ -27,6 +28,7 @@ class Schema < Info
super
@targetnamespace = nil
@complextypes = XSD::NamedElements.new
@simpletypes = XSD::NamedElements.new
@elements = XSD::NamedElements.new
@attributes = XSD::NamedElements.new
@imports = []
@ -44,8 +46,9 @@ class Schema < Info
@complextypes << o
o
when SimpleTypeName
STDERR.puts("Restriction of basetype with simpleType definition is ignored for now.")
nil
o = SimpleType.new
@simpletypes << o
o
when ElementName
o = Element.new
@elements << o
@ -83,6 +86,12 @@ class Schema < Info
result
end
def collect_simpletypes
result = XSD::NamedElements.new
result.concat(@simpletypes)
result
end
def self.parse_element(element)
if element == SchemaName
Schema.new