Esempio n. 1
0
        private string FindSoapAction(BindingOperationType op2)
        {
            if (op2.AnyAttr == null)
            {
                return(String.Empty);
            }

            var v = op2.AnyAttr.SingleOrDefault(
                s => (s.LocalName == "soapAction" || s.LocalName == "action") && s.NamespaceURI == "http://www.w3.org/ns/wsdl/soap");

            return(v == null ? String.Empty : v.Value);
        }
Esempio n. 2
0
        private void HandleHeaders(ServiceDescription wsdl, BindingOperationType op2, ItemsChoiceType1 type, MessageBinding mb, SoapVersion v)
        {
            if (op2.Items == null)
            {
                return;
            }

            for (int i = 0; i < op2.Items.Length; i++)
            {
                var curr = op2.Items[i] as BindingOperationMessageType;
                if (curr == null)
                {
                    continue;
                }

                if (op2.ItemsElementName[i] != type)
                {
                    continue;
                }

                if (curr.Items == null)
                {
                    continue;
                }

                var headers = curr.Items.Where(s => s.LocalName == "header" &&
                                               s.NamespaceURI == "http://www.w3.org/ns/wsdl/soap");
                foreach (var n in headers)
                {
                    var header = v == SoapVersion.Soap11 ? new SoapHeaderBinding() : new Soap12HeaderBinding();
                    header.Use = SoapBindingUse.Literal;

                    if (n.Attributes["element"] == null)
                    {
                        return;
                    }

                    var          qName    = new XmlQualifiedName(n.Attributes["element"].Value);
                    const string partName = "H";
                    header.Message = CreateMessage(wsdl, String.Format("{0}Header_{1}", [email protected], unique++), qName, partName);
                    header.Part    = partName;

                    mb.Extensions.Add(header);
                }
            }
        }
Esempio n. 3
0
        private void HandleHeaders(ServiceDescription wsdl, BindingOperationType op2, ItemsChoiceType1 type, MessageBinding mb, SoapVersion v)
        {
            if (op2.Items == null)
                return;

            for (int i = 0; i < op2.Items.Length; i++)
            {
                var curr = op2.Items[i] as BindingOperationMessageType;
                if (curr == null)
                    continue;

                if (op2.ItemsElementName[i] != type)
                    continue;

                if (curr.Items == null)
                    continue;

                var headers = curr.Items.Where(s => s.LocalName == "header"
                    && s.NamespaceURI == "http://www.w3.org/ns/wsdl/soap");
                foreach (var n in headers)
                {
                    var header = v == SoapVersion.Soap11 ? new SoapHeaderBinding() : new Soap12HeaderBinding();
                    header.Use = SoapBindingUse.Literal;

                    if (n.Attributes["element"] == null)
                        return;

                    var qName = new XmlQualifiedName(n.Attributes["element"].Value);
                    const string partName = "H";
                    header.Message = CreateMessage(wsdl, String.Format("{0}Header_{1}", [email protected], unique++), qName, partName);
                    header.Part = partName;

                    mb.Extensions.Add(header);
                }

            }
        }
Esempio n. 4
0
        private string FindSoapAction(BindingOperationType op2)
        {
            if (op2.AnyAttr == null)
                return String.Empty;

            var v = op2.AnyAttr.SingleOrDefault(
                s => (s.LocalName == "soapAction" || s.LocalName == "action") && s.NamespaceURI == "http://www.w3.org/ns/wsdl/soap");

            return v == null ? String.Empty : v.Value;
        }