Пример #1
0
        /// <summary>
        /// Finds a WSDLInformation's operation by message.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <returns></returns>
        public WSDLOperation FindOperationByMessage(string message)
        {
            WSDLOperation result = null;

            result = message.Contains("Response") ? Operations.Cast <WSDLOperation>().FirstOrDefault(o => WSDLHelpers.TrimNamespace(o.OutputMessage) == message) :
                     Operations.Cast <WSDLOperation>().FirstOrDefault(o => WSDLHelpers.TrimNamespace(o.InputMessage) == message);

            return(result);
        }
Пример #2
0
        /// <summary>
        /// Finds an operation by its parameter name
        /// </summary>
        /// <param name="input">The name of the </param>
        /// <returns></returns>
        public WSDLOperation FindOperationByParameter(string parameter)
        {
            WSDLOperation result = null;

            if (parameter.Contains("SoapIn"))
            {
                result = Operations.Cast <WSDLOperation>().First(o => WSDLHelpers.TrimNamespace(o.Input) == parameter);
            }
            else if (parameter.Contains("SoapOut"))
            {
                result = Operations.Cast <WSDLOperation>().First(o => WSDLHelpers.TrimNamespace(o.Output) == parameter);
            }

            return(result);
        }
Пример #3
0
        /// <summary>
        /// Retrieves and parses the Port from the WSDL Xml structure
        /// </summary>
        /// <param name="info">The WSDL Information we are parsing out </param>
        /// <returns></returns>
        public WSDLInformation GetPort(WSDLInformation info)
        {
            WSDLPort port = new WSDLPort();

            // Grab the wsdl:service to be able to get the name of the service.
            XmlNode first = _portNodes.Cast <XmlNode>().First().ParentNode;

            info.Service.Name = first.GetTextAttribute("name", "wsdl:service");
            info.BaseName     = info.Service.Name;

            // Generate the portkey to be able to get the direct port that we need. We are focusing on soap12
            string  portKey  = info.Service.Name += WSDLHelpers.SOAP_12_SUFFIX;
            XmlNode portNode = _portNodes.Cast <XmlNode>().First(p => p.GetTextAttribute("name", "wsdl:portNode") == portKey);

            // Build the port from the portNode XMLNode.
            info.Port.Name     = WSDLHelpers.TrimNamespace(portNode.GetTextAttribute("name", "wsdl:portNode"));
            info.Port.Binding  = WSDLHelpers.TrimNamespace(portNode.GetTextAttribute("binding", "wsdl:portNode"));
            info.Port.Location = portNode.FirstChild.GetTextAttribute("location", "soap:address");

            return(info);
        }