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

Changeset 1551

Show
Ignore:
Timestamp:
05/18/05 23:35:05 (4 years ago)
Author:
nahi
Message:

doc/lit service now can be invoked without SOAPAction. if no SOAPAction given, Router searches operations with QName of root element of SOAPBody. many thanks to Emil Marceta. closes #108.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/soap/rpc/router.rb

    r1520 r1551  
    116116 
    117117  def add_document_operation(receiver, soapaction, name, param_def, opt = {}) 
    118     unless soapaction 
    119       raise RPCRoutingError.new("soapaction is a must for document method") 
    120     end 
     118    # 
     119    # adopt workaround for doc/lit wrapper method 
     120    # (you should consider to simply use rpc/lit service) 
     121    # 
     122    #unless soapaction 
     123    #  raise RPCRoutingError.new("soapaction is a must for document method") 
     124    #end 
    121125    ensure_styleuse_option(opt, :document, :literal) 
    122126    op = ApplicationScopeOperation.new(soapaction, receiver, name, param_def, 
     
    125129      raise RPCRoutingError.new("illegal request_style given") 
    126130    end 
    127     assign_operation(soapaction, nil, op) 
     131    assign_operation(soapaction, first_input_part_qname(param_def), op) 
    128132  end 
    129133  alias add_document_method add_document_operation 
    130134 
    131135  def add_document_request_operation(factory, soapaction, name, param_def, opt = {}) 
    132     unless soapaction 
    133       raise RPCRoutingError.new("soapaction is a must for document method") 
    134     end 
     136    # 
     137    # adopt workaround for doc/lit wrapper method 
     138    # (you should consider to simply use rpc/lit service) 
     139    # 
     140    #unless soapaction 
     141    #  raise RPCRoutingError.new("soapaction is a must for document method") 
     142    #end 
    135143    ensure_styleuse_option(opt, :document, :literal) 
    136144    op = RequestScopeOperation.new(soapaction, receiver, name, param_def, opt) 
     
    138146      raise RPCRoutingError.new("illegal request_style given") 
    139147    end 
    140     assign_operation(soapaction, nil, op) 
     148    assign_operation(soapaction, first_input_part_qname(param_def), op) 
    141149  end 
    142150 
     
    184192 
    185193private 
     194 
     195  def first_input_part_qname(param_def) 
     196    param_def.each do |inout, paramname, typeinfo| 
     197      if inout == SOAPMethod::IN 
     198        klass, nsdef, namedef = typeinfo 
     199        return XSD::QName.new(nsdef, namedef) 
     200      end 
     201    end 
     202    nil 
     203  end 
    186204 
    187205  def create_styleuse_option(style, use)