Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 1076

Show
Ignore:
Timestamp:
11/29/03 15:04:05 (5 years ago)
Author:
nahi
Message:

* moving methods.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/wsdl/soap/definitions.rb

    r1058 r1076  
    1616 
    1717class Definitions < Info 
    18   def soap_rpc_complextypes(binding) 
    19     types = rpc_operation_complextypes(binding) 
     18  def self.soap_rpc_complextypes 
     19    types = XSD::NamedElements.new 
    2020    types << array_complextype 
    2121    types << fault_complextype 
    2222    types << exception_complextype 
    2323    types 
     24  end 
     25 
     26  def self.array_complextype 
     27    type = XMLSchema::ComplexType.new(::SOAP::ValueArrayName) 
     28    type.complexcontent = XMLSchema::ComplexContent.new 
     29    type.complexcontent.base = ::SOAP::ValueArrayName 
     30    attr = XMLSchema::Attribute.new 
     31    attr.ref = ::SOAP::AttrArrayTypeName 
     32    anytype = XSD::AnyTypeName.dup 
     33    anytype.name += '[]' 
     34    attr.arytype = anytype 
     35    type.complexcontent.attributes << attr 
     36    type 
     37  end 
     38 
     39=begin 
     40<xs:complexType name="Fault" final="extension"> 
     41  <xs:sequence> 
     42    <xs:element name="faultcode" type="xs:QName" />  
     43    <xs:element name="faultstring" type="xs:string" />  
     44    <xs:element name="faultactor" type="xs:anyURI" minOccurs="0" />  
     45    <xs:element name="detail" type="tns:detail" minOccurs="0" />  
     46  </xs:sequence> 
     47</xs:complexType> 
     48=end 
     49  def self.fault_complextype 
     50    type = XMLSchema::ComplexType.new(::SOAP::EleFaultName) 
     51    faultcode = XMLSchema::Element.new(::SOAP::EleFaultCodeName, XSD::XSDQName::Type) 
     52    faultstring = XMLSchema::Element.new(::SOAP::EleFaultStringName, XSD::XSDString::Type) 
     53    faultactor = XMLSchema::Element.new(::SOAP::EleFaultActorName, XSD::XSDAnyURI::Type) 
     54    faultactor.minoccurs = 0 
     55    detail = XMLSchema::Element.new(::SOAP::EleFaultDetailName, XSD::AnyTypeName) 
     56    detail.minoccurs = 0 
     57    type.all_elements = [faultcode, faultstring, faultactor, detail] 
     58    type.final = 'extension' 
     59    type 
     60  end 
     61 
     62  def self.exception_complextype 
     63    type = XMLSchema::ComplexType.new(XSD::QName.new( 
     64        ::SOAP::Mapping::RubyCustomTypeNamespace, 'SOAPException')) 
     65    excn_name = XMLSchema::Element.new(XSD::QName.new(nil, 'excn_type_name'), XSD::XSDString::Type) 
     66    cause = XMLSchema::Element.new(XSD::QName.new(nil, 'cause'), XSD::AnyTypeName) 
     67    backtrace = XMLSchema::Element.new(XSD::QName.new(nil, 'backtrace'), ::SOAP::ValueArrayName) 
     68    message = XMLSchema::Element.new(XSD::QName.new(nil, 'message'), XSD::XSDString::Type) 
     69    type.all_elements = [excn_name, cause, backtrace, message] 
     70    type 
     71  end 
     72 
     73  def soap_rpc_complextypes(binding) 
     74    types = rpc_operation_complextypes(binding) 
     75    types + self.class.soap_rpc_complextypes 
    2476  end 
    2577 
     
    67119    } 
    68120  end 
    69  
    70   def array_complextype 
    71     type = XMLSchema::ComplexType.new(::SOAP::ValueArrayName) 
    72     type.complexcontent = XMLSchema::ComplexContent.new 
    73     type.complexcontent.base = ::SOAP::ValueArrayName 
    74     attr = XMLSchema::Attribute.new 
    75     attr.ref = ::SOAP::AttrArrayTypeName 
    76     anytype = XSD::AnyTypeName.dup 
    77     anytype.name += '[]' 
    78     attr.arytype = anytype 
    79     type.complexcontent.attributes << attr 
    80     type 
    81   end 
    82  
    83 =begin 
    84 <xs:complexType name="Fault" final="extension"> 
    85   <xs:sequence> 
    86     <xs:element name="faultcode" type="xs:QName" />  
    87     <xs:element name="faultstring" type="xs:string" />  
    88     <xs:element name="faultactor" type="xs:anyURI" minOccurs="0" />  
    89     <xs:element name="detail" type="tns:detail" minOccurs="0" />  
    90   </xs:sequence> 
    91 </xs:complexType> 
    92 =end 
    93   def fault_complextype 
    94     type = XMLSchema::ComplexType.new(::SOAP::EleFaultName) 
    95     faultcode = XMLSchema::Element.new(::SOAP::EleFaultCodeName, XSD::XSDQName::Type) 
    96     faultstring = XMLSchema::Element.new(::SOAP::EleFaultStringName, XSD::XSDString::Type) 
    97     faultactor = XMLSchema::Element.new(::SOAP::EleFaultActorName, XSD::XSDAnyURI::Type) 
    98     faultactor.minoccurs = 0 
    99     detail = XMLSchema::Element.new(::SOAP::EleFaultDetailName, XSD::AnyTypeName) 
    100     detail.minoccurs = 0 
    101     type.all_elements = [faultcode, faultstring, faultactor, detail] 
    102     type.final = 'extension' 
    103     type 
    104   end 
    105  
    106   def exception_complextype 
    107     type = XMLSchema::ComplexType.new(XSD::QName.new( 
    108         ::SOAP::Mapping::RubyCustomTypeNamespace, 'SOAPException')) 
    109     excn_name = XMLSchema::Element.new(XSD::QName.new(nil, 'excn_type_name'), XSD::XSDString::Type) 
    110     cause = XMLSchema::Element.new(XSD::QName.new(nil, 'cause'), XSD::AnyTypeName) 
    111     backtrace = XMLSchema::Element.new(XSD::QName.new(nil, 'backtrace'), ::SOAP::ValueArrayName) 
    112     message = XMLSchema::Element.new(XSD::QName.new(nil, 'message'), XSD::XSDString::Type) 
    113     type.all_elements = [excn_name, cause, backtrace, message] 
    114     type 
    115   end 
    116121end 
    117122