|
Revision 1824, 1.2 kB
(checked in by nahi, 2 years ago)
|
- Copyright notice updated. add '2000-2007' uniformly.
|
- Property svn:eol-style set to
native
- Property svn:keywords set to
author date id revision
|
| Line | |
|---|
| 1 |
# WSDL4R - WSDL binding definition. |
|---|
| 2 |
# Copyright (C) 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>. |
|---|
| 3 |
|
|---|
| 4 |
# This program is copyrighted free software by NAKAMURA, Hiroshi. You can |
|---|
| 5 |
# redistribute it and/or modify it under the same terms of Ruby's license; |
|---|
| 6 |
# either the dual license version in 2003, or any later version. |
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
require 'wsdl/info' |
|---|
| 10 |
require 'xsd/namedelements' |
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
module WSDL |
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
class Binding < Info |
|---|
| 17 |
attr_reader :name # required |
|---|
| 18 |
attr_reader :type # required |
|---|
| 19 |
attr_reader :operations |
|---|
| 20 |
attr_reader :soapbinding |
|---|
| 21 |
|
|---|
| 22 |
def initialize |
|---|
| 23 |
super |
|---|
| 24 |
@name = nil |
|---|
| 25 |
@type = nil |
|---|
| 26 |
@operations = XSD::NamedElements.new |
|---|
| 27 |
@soapbinding = nil |
|---|
| 28 |
end |
|---|
| 29 |
|
|---|
| 30 |
def targetnamespace |
|---|
| 31 |
parent.targetnamespace |
|---|
| 32 |
end |
|---|
| 33 |
|
|---|
| 34 |
def parse_element(element) |
|---|
| 35 |
case element |
|---|
| 36 |
when OperationName |
|---|
| 37 |
o = OperationBinding.new |
|---|
| 38 |
@operations << o |
|---|
| 39 |
o |
|---|
| 40 |
when SOAPBindingName |
|---|
| 41 |
o = WSDL::SOAP::Binding.new |
|---|
| 42 |
@soapbinding = o |
|---|
| 43 |
o |
|---|
| 44 |
when DocumentationName |
|---|
| 45 |
o = Documentation.new |
|---|
| 46 |
o |
|---|
| 47 |
else |
|---|
| 48 |
nil |
|---|
| 49 |
end |
|---|
| 50 |
end |
|---|
| 51 |
|
|---|
| 52 |
def parse_attr(attr, value) |
|---|
| 53 |
case attr |
|---|
| 54 |
when NameAttrName |
|---|
| 55 |
@name = XSD::QName.new(targetnamespace, value.source) |
|---|
| 56 |
when TypeAttrName |
|---|
| 57 |
@type = value |
|---|
| 58 |
else |
|---|
| 59 |
nil |
|---|
| 60 |
end |
|---|
| 61 |
end |
|---|
| 62 |
end |
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
end |
|---|