Example #1
0
        void CreateOutputBinding(ServiceEndpoint endpoint, OperationBinding op_binding,
                                 MessageDescription sm_md)
        {
            var out_binding = new OutputBinding();

            op_binding.Output = out_binding;

            var message_version = endpoint.Binding.MessageVersion ?? MessageVersion.None;

            if (message_version == MessageVersion.None)
            {
                return;
            }

            SoapBodyBinding soap_body_binding;

            if (message_version.Envelope == EnvelopeVersion.Soap11)
            {
                soap_body_binding = new SoapBodyBinding();
            }
            else if (message_version.Envelope == EnvelopeVersion.Soap12)
            {
                soap_body_binding = new Soap12BodyBinding();
            }
            else
            {
                throw new InvalidOperationException();
            }

            soap_body_binding.Use = SoapBindingUse.Literal;
            out_binding.Extensions.Add(soap_body_binding);
        }
        protected override SoapBodyBinding CreateSoapBodyBinding(SoapBindingUse use, string ns)
        {
            Soap12BodyBinding soapBodyBinding = new Soap12BodyBinding();

            soapBodyBinding.Use = use;
            if (use == SoapBindingUse.Encoded)
            {
                soapBodyBinding.Encoding = Soap12.Encoding;
            }
            soapBodyBinding.Namespace = ns;
            return(soapBodyBinding);
        }
 protected override SoapBodyBinding CreateSoapBodyBinding(SoapBindingUse use, string ns)
 {
     Soap12BodyBinding binding = new Soap12BodyBinding {
         Use = use
     };
     if (use == SoapBindingUse.Encoded)
     {
         binding.Encoding = "http://www.w3.org/2003/05/soap-encoding";
     }
     binding.Namespace = ns;
     return binding;
 }
Example #4
0
        protected override SoapBodyBinding CreateSoapBodyBinding(SoapBindingUse use, string ns)
        {
            Soap12BodyBinding binding = new Soap12BodyBinding {
                Use = use
            };

            if (use == SoapBindingUse.Encoded)
            {
                binding.Encoding = "http://www.w3.org/2003/05/soap-encoding";
            }
            binding.Namespace = ns;
            return(binding);
        }
Example #5
0
        private static SoapBodyBinding CreateSoapBodyBinding(EnvelopeVersion version, MessageBinding wsdlMessageBinding)
        {
            SoapBodyBinding extension = null;

            if (version == EnvelopeVersion.Soap12)
            {
                extension = new Soap12BodyBinding();
            }
            else if (version == EnvelopeVersion.Soap11)
            {
                extension = new SoapBodyBinding();
            }
            wsdlMessageBinding.Extensions.Add(extension);
            return(extension);
        }
        private static object GetSoapBodyBinding(System.ServiceModel.Channels.Binding binding)
        {
            if (binding.MessageVersion.Envelope == EnvelopeVersion.Soap11)
            {
                SoapBodyBinding soapBinding = new SoapBodyBinding();
                soapBinding.Use = SoapBindingUse.Literal;
                return(soapBinding);
            }
            else if (binding.MessageVersion.Envelope == EnvelopeVersion.Soap12)
            {
                Soap12BodyBinding soap12Binding = new Soap12BodyBinding();
                soap12Binding.Use = SoapBindingUse.Literal;
                return(soap12Binding);
            }

            return(null);
        }
Example #7
0
        void CreateInputBinding(ServiceEndpoint endpoint, OperationBinding op_binding,
                                MessageDescription sm_md)
        {
            var in_binding = new InputBinding();

            op_binding.Input = in_binding;

            var message_version = endpoint.Binding.MessageVersion ?? MessageVersion.None;

            if (message_version == MessageVersion.None)
            {
                return;
            }

            SoapBodyBinding      soap_body_binding;
            SoapOperationBinding soap_operation_binding;

            if (message_version.Envelope == EnvelopeVersion.Soap11)
            {
                soap_body_binding      = new SoapBodyBinding();
                soap_operation_binding = new SoapOperationBinding();
            }
            else if (message_version.Envelope == EnvelopeVersion.Soap12)
            {
                soap_body_binding      = new Soap12BodyBinding();
                soap_operation_binding = new Soap12OperationBinding();
            }
            else
            {
                throw new InvalidOperationException();
            }

            soap_body_binding.Use = SoapBindingUse.Literal;
            in_binding.Extensions.Add(soap_body_binding);

            //Set Action
            //<operation > <soap:operation soapAction .. >
            soap_operation_binding.SoapAction = sm_md.Action;
            soap_operation_binding.Style      = SoapBindingStyle.Document;
            op_binding.Extensions.Add(soap_operation_binding);
        }
 private void Write102_Soap12BodyBinding(string n, string ns, Soap12BodyBinding o, bool isNullable, bool needType)
 {
     if (o == null)
     {
         if (isNullable)
         {
             base.WriteNullTagLiteral(n, ns);
         }
     }
     else
     {
         if (!needType && !(o.GetType() == typeof(Soap12BodyBinding)))
         {
             throw base.CreateUnknownTypeException(o);
         }
         base.WriteStartElement(n, ns, o, false, null);
         if (needType)
         {
             base.WriteXsiType("Soap12BodyBinding", "http://schemas.xmlsoap.org/wsdl/soap12/");
         }
         if (o.Required)
         {
             base.WriteAttribute("required", "http://schemas.xmlsoap.org/wsdl/", XmlConvert.ToString(o.Required));
         }
         if (o.Use != SoapBindingUse.Default)
         {
             base.WriteAttribute("use", "", this.Write100_SoapBindingUse(o.Use));
         }
         if ((o.Namespace != null) && (o.Namespace.Length != 0))
         {
             base.WriteAttribute("namespace", "", o.Namespace);
         }
         if ((o.Encoding != null) && (o.Encoding.Length != 0))
         {
             base.WriteAttribute("encodingStyle", "", o.Encoding);
         }
         base.WriteAttribute("parts", "", o.PartsString);
         base.WriteEndElement(o);
     }
 }
Example #9
0
		void CreateOutputBinding (ServiceEndpoint endpoint, OperationBinding op_binding,
		                          MessageDescription sm_md)
		{
			var out_binding = new OutputBinding ();
			op_binding.Output = out_binding;

			var message_version = endpoint.Binding.MessageVersion ?? MessageVersion.None;
			if (message_version == MessageVersion.None)
				return;

			SoapBodyBinding soap_body_binding;
			if (message_version.Envelope == EnvelopeVersion.Soap11) {
				soap_body_binding = new SoapBodyBinding ();
			} else if (message_version.Envelope == EnvelopeVersion.Soap12) {
				soap_body_binding = new Soap12BodyBinding ();
			} else {
				throw new InvalidOperationException ();
			}

			soap_body_binding.Use = SoapBindingUse.Literal;
			out_binding.Extensions.Add (soap_body_binding);
		}
Example #10
0
		void CreateInputBinding (ServiceEndpoint endpoint, OperationBinding op_binding,
		                         MessageDescription sm_md)
		{
			var in_binding = new InputBinding ();
			op_binding.Input = in_binding;

			var message_version = endpoint.Binding.MessageVersion ?? MessageVersion.None;
			if (message_version == MessageVersion.None)
				return;

			SoapBodyBinding soap_body_binding;
			SoapOperationBinding soap_operation_binding;
			if (message_version.Envelope == EnvelopeVersion.Soap11) {
				soap_body_binding = new SoapBodyBinding ();
				soap_operation_binding = new SoapOperationBinding ();
			} else if (message_version.Envelope == EnvelopeVersion.Soap12) {
				soap_body_binding = new Soap12BodyBinding ();
				soap_operation_binding = new Soap12OperationBinding ();
			} else {
				throw new InvalidOperationException ();
			}

			soap_body_binding.Use = SoapBindingUse.Literal;
			in_binding.Extensions.Add (soap_body_binding);
				
			//Set Action
			//<operation > <soap:operation soapAction .. >
			soap_operation_binding.SoapAction = sm_md.Action;
			soap_operation_binding.Style = SoapBindingStyle.Document;
			op_binding.Extensions.Add (soap_operation_binding);
		}
        private static object GetSoapBodyBinding(System.ServiceModel.Channels.Binding binding)
        {
            if (binding.MessageVersion.Envelope == EnvelopeVersion.Soap11)
            {
                SoapBodyBinding soapBinding = new SoapBodyBinding();
                soapBinding.Use = SoapBindingUse.Literal;
                return soapBinding;
            }
            else if (binding.MessageVersion.Envelope == EnvelopeVersion.Soap12)
            {
                Soap12BodyBinding soap12Binding = new Soap12BodyBinding();
                soap12Binding.Use = SoapBindingUse.Literal;
                return soap12Binding;
            }

            return null;
        }
 protected override SoapBodyBinding CreateSoapBodyBinding(SoapBindingUse use, string ns) {
     Soap12BodyBinding soapBodyBinding = new Soap12BodyBinding();
     soapBodyBinding.Use = use;
     if (use == SoapBindingUse.Encoded)
         soapBodyBinding.Encoding = Soap12.Encoding;
     soapBodyBinding.Namespace = ns;
     return soapBodyBinding;
 }