mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
29c5ab0b77
#nnn is a ticket number at http://dev.ctor.org/soap4r * SOAP * allow to configure an envelope namespace of SOAP request. (#124) TemporaryNamespace = 'http://www.w3.org/2003/05/soap-envelope' @client.options["soap.envelope.requestnamespace"] = TemporaryNamespace @client.options["soap.envelope.responsenamespace"] = TemporaryNamespace @client.do_proc(...) * let SOAP request XML indent space configuable. see "soap.envelope.no_indent" option. (#130) * let external CES configuable. ex. client["soap.mapping.external_ces"] = 'SJIS'. $KCODE is used by default. (#133) external CES ::= CES used in Ruby object of client and server internal CES ::= CES used in SOAP/OM * add iso-8859-1 external CES support. (#106) * fixed illegal 'qualified' handling of elements. it caused ASP.NET inteoperability problem. (#144) * added 'soap.envelope.use_numeric_character_reference' (boolean) option to let query XML use numeric character reference in XML, not plain UTF-8 character. !GoogleSearch server seems to not allow plain UTF-8 character since 2005-08-15 update. (#147) * SOAP::Header::SimpleHeader (de)serialization throws an exception on !SimpleHeader.on_(in|out)bound when header is a String. so we could not use a simple single element headerItem. fixed. thanks to emil. (#129) * out parameter of rpc operation did not work. (#132) * follow HTTP redirect only if using http-access2. (#125) (#145) * add a workaround for importing an WSDL whose path begins with drive letter. (#115) * WSDL * SOAP Data which is defined as a simpletype was not mapped correctly to Ruby obj when using wsdl2ruby.rb generated classdef file. (#123) * rpc/literal support. (#118) * re-implemented local element qualify/unqualify control. handles elementFormDefault and form in WSDL. (#119) * Array of an element which has simpleType causes a crash. (#128) * prarmeterOrder may not contain return part so it can be shorter than parts size. Thanks to Hugh. (#139) * Samples * added !BasicAuth client sample. (#117) * added Base64 client/server sample. * added Flickr SOAP interface client sample. (#122) * added !SalesForce client sample. (#135) * updated Thawte CA certificate for !GoogleAdWords sample. * updated a client script with the newer version made by Johan. thanks! * shortened long file names. (#120) * fixed typo in authheader sample. (#129) * updated deprecated method usage. (#138) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
130 lines
2.6 KiB
Ruby
130 lines
2.6 KiB
Ruby
# WSDL4R - WSDL operation definition.
|
|
# Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
|
|
|
|
# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
|
|
# redistribute it and/or modify it under the same terms of Ruby's license;
|
|
# either the dual license version in 2003, or any later version.
|
|
|
|
|
|
require 'wsdl/info'
|
|
|
|
|
|
module WSDL
|
|
|
|
|
|
class Operation < Info
|
|
class NameInfo
|
|
attr_reader :op_name
|
|
attr_reader :optype_name
|
|
attr_reader :parts
|
|
def initialize(op_name, optype_name, parts)
|
|
@op_name = op_name
|
|
@optype_name = optype_name
|
|
@parts = parts
|
|
end
|
|
end
|
|
|
|
attr_reader :name # required
|
|
attr_reader :parameter_order # optional
|
|
attr_reader :input
|
|
attr_reader :output
|
|
attr_reader :fault
|
|
attr_reader :type # required
|
|
|
|
def initialize
|
|
super
|
|
@name = nil
|
|
@type = nil
|
|
@parameter_order = nil
|
|
@input = nil
|
|
@output = nil
|
|
@fault = []
|
|
end
|
|
|
|
def targetnamespace
|
|
parent.targetnamespace
|
|
end
|
|
|
|
def input_info
|
|
typename = input.find_message.name
|
|
NameInfo.new(@name, typename, inputparts)
|
|
end
|
|
|
|
def output_info
|
|
typename = output.find_message.name
|
|
NameInfo.new(@name, typename, outputparts)
|
|
end
|
|
|
|
def inputparts
|
|
sort_parts(input.find_message.parts)
|
|
end
|
|
|
|
def inputname
|
|
XSD::QName.new(targetnamespace, input.name ? input.name.name : @name.name)
|
|
end
|
|
|
|
def outputparts
|
|
sort_parts(output.find_message.parts)
|
|
end
|
|
|
|
def outputname
|
|
XSD::QName.new(targetnamespace,
|
|
output.name ? output.name.name : @name.name + 'Response')
|
|
end
|
|
|
|
def parse_element(element)
|
|
case element
|
|
when InputName
|
|
o = Param.new
|
|
@input = o
|
|
o
|
|
when OutputName
|
|
o = Param.new
|
|
@output = o
|
|
o
|
|
when FaultName
|
|
o = Param.new
|
|
@fault << o
|
|
o
|
|
when DocumentationName
|
|
o = Documentation.new
|
|
o
|
|
else
|
|
nil
|
|
end
|
|
end
|
|
|
|
def parse_attr(attr, value)
|
|
case attr
|
|
when NameAttrName
|
|
@name = XSD::QName.new(targetnamespace, value.source)
|
|
when TypeAttrName
|
|
@type = value
|
|
when ParameterOrderAttrName
|
|
@parameter_order = value.source.split(/\s+/)
|
|
else
|
|
nil
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def sort_parts(parts)
|
|
return parts.dup unless parameter_order
|
|
result = []
|
|
parameter_order.each do |orderitem|
|
|
if (ele = parts.find { |part| part.name == orderitem })
|
|
result << ele
|
|
end
|
|
end
|
|
if result.length == 0
|
|
return parts.dup
|
|
end
|
|
# result length can be shorter than parts's.
|
|
# return part must not be a part of the parameterOrder.
|
|
result
|
|
end
|
|
end
|
|
|
|
|
|
end
|