Flowdock
method

find_port

Importance_0
v1_8_7_330 - Show latest stable - 0 notes - Class: SOAP::WSDLDriverFactory
find_port(servicename = nil, portname = nil) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/soap/wsdlDriver.rb, line 56
  def find_port(servicename = nil, portname = nil)
    service = port = nil
    if servicename
      service = @wsdl.service(
        XSD::QName.new(@wsdl.targetnamespace, servicename))
    else
      service = @wsdl.services[0]
    end
    if service.nil?
      raise FactoryError.new("service #{servicename} not found in WSDL")
    end
    if portname
      port = service.ports[XSD::QName.new(@wsdl.targetnamespace, portname)]
      if port.nil?
        raise FactoryError.new("port #{portname} not found in WSDL")
      end
    else
      port = service.ports.find { |port| !port.soap_address.nil? }
      if port.nil?
        raise FactoryError.new("no ports have soap:address")
      end
    end
    if port.soap_address.nil?
      raise FactoryError.new("soap:address element not found in WSDL")
    end
    port
  end
Register or log in to add new notes.