private void DealWithAmbiguity(string action, string requestElement, Soap12OperationBinding operation) { Soap12OperationBinding binding = (Soap12OperationBinding)this.actions[action]; if (binding != null) { operation.DuplicateBySoapAction = binding; binding.DuplicateBySoapAction = operation; this.CheckOperationDuplicates(binding); } else { this.actions[action] = operation; } Soap12OperationBinding binding2 = (Soap12OperationBinding)this.requestElements[requestElement]; if (binding2 != null) { operation.DuplicateByRequestElement = binding2; binding2.DuplicateByRequestElement = operation; this.CheckOperationDuplicates(binding2); } else { this.requestElements[requestElement] = operation; } this.CheckOperationDuplicates(operation); }
private void DealWithAmbiguity(string action, string requestElement, Soap12OperationBinding operation) { Soap12OperationBinding duplicateActionOperation = (Soap12OperationBinding)actions[action]; if (duplicateActionOperation != null) { operation.DuplicateBySoapAction = duplicateActionOperation; duplicateActionOperation.DuplicateBySoapAction = operation; CheckOperationDuplicates(duplicateActionOperation); } else { actions[action] = operation; } Soap12OperationBinding duplicateRequestElementOperation = (Soap12OperationBinding)requestElements[requestElement]; if (duplicateRequestElementOperation != null) { operation.DuplicateByRequestElement = duplicateRequestElementOperation; duplicateRequestElementOperation.DuplicateByRequestElement = operation; CheckOperationDuplicates(duplicateRequestElementOperation); } else { requestElements[requestElement] = operation; } CheckOperationDuplicates(operation); }
protected override SoapOperationBinding CreateSoapOperationBinding(SoapBindingStyle style, string action) { Soap12OperationBinding operation = new Soap12OperationBinding { SoapAction = action, Style = style, Method = base.SoapMethod }; this.DealWithAmbiguity(action, base.SoapMethod.requestElementName.ToString(), operation); return(operation); }
protected override SoapOperationBinding CreateSoapOperationBinding(SoapBindingStyle style, string action) { Soap12OperationBinding soapOperation = new Soap12OperationBinding(); soapOperation.SoapAction = action; soapOperation.Style = style; soapOperation.Method = SoapMethod; DealWithAmbiguity(action, SoapMethod.requestElementName.ToString(), soapOperation); return(soapOperation); }
private void CheckOperationDuplicates(Soap12OperationBinding operation) { if (operation.DuplicateByRequestElement != null) { if (operation.DuplicateBySoapAction != null) { throw new InvalidOperationException(System.Web.Services.Res.GetString("TheMethodsAndUseTheSameRequestElementAndSoapActionXmlns6", new object[] { operation.Method.name, operation.DuplicateByRequestElement.Method.name, operation.Method.requestElementName.Name, operation.Method.requestElementName.Namespace, operation.DuplicateBySoapAction.Method.name, operation.Method.action })); } operation.SoapActionRequired = true; } else { operation.SoapActionRequired = false; } }
private void CheckOperationDuplicates(Soap12OperationBinding operation) { if (operation.DuplicateByRequestElement != null) { if (operation.DuplicateBySoapAction != null) { throw new InvalidOperationException(System.Web.Services.Res.GetString("TheMethodsAndUseTheSameRequestElementAndSoapActionXmlns6", new object[] { operation.Method.name, operation.DuplicateByRequestElement.Method.name, operation.Method.requestElementName.Name, operation.Method.requestElementName.Namespace, operation.DuplicateBySoapAction.Method.name, operation.Method.action })); } operation.SoapActionRequired = true; } else { operation.SoapActionRequired = false; } }
static WsdlNS.SoapOperationBinding CreateSoapOperationBinding(EnvelopeVersion version, WsdlNS.OperationBinding wsdlOperationBinding) { WsdlNS.SoapOperationBinding soapOperationBinding = null; if (version == EnvelopeVersion.Soap12) { soapOperationBinding = new WsdlNS.Soap12OperationBinding(); } else if (version == EnvelopeVersion.Soap11) { soapOperationBinding = new WsdlNS.SoapOperationBinding(); } Fx.Assert(soapOperationBinding != null, "EnvelopeVersion is not recognized. Please update the SoapHelper class"); wsdlOperationBinding.Extensions.Add(soapOperationBinding); return(soapOperationBinding); }
private void CheckOperationDuplicates(Soap12OperationBinding operation) { // we require soap action if we can't route on request element if (operation.DuplicateByRequestElement != null) { // except if we also can't route on soap action, which is an error if (operation.DuplicateBySoapAction != null) { throw new InvalidOperationException(Res.GetString(Res.TheMethodsAndUseTheSameRequestElementAndSoapActionXmlns6, operation.Method.name, operation.DuplicateByRequestElement.Method.name, operation.Method.requestElementName.Name, operation.Method.requestElementName.Namespace, operation.DuplicateBySoapAction.Method.name, operation.Method.action)); } else { operation.SoapActionRequired = true; } } else { operation.SoapActionRequired = false; } }
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 GetSoapOperationBinding(System.ServiceModel.Channels.Binding binding, string action) { if (binding.MessageVersion.Envelope == EnvelopeVersion.Soap11) { SoapOperationBinding soapOperationBinding = new SoapOperationBinding(); soapOperationBinding.SoapAction = action; soapOperationBinding.Style = SoapBindingStyle.Document; return soapOperationBinding; } else if (binding.MessageVersion.Envelope == EnvelopeVersion.Soap12) { Soap12OperationBinding soapOperationBinding = new Soap12OperationBinding(); soapOperationBinding.SoapAction = action; soapOperationBinding.Style = SoapBindingStyle.Document; return soapOperationBinding; } return null; }
private void Write88_Soap12OperationBinding(string n, string ns, Soap12OperationBinding o, bool isNullable, bool needType) { if (o == null) { if (isNullable) { base.WriteNullTagLiteral(n, ns); } } else { if (!needType && !(o.GetType() == typeof(Soap12OperationBinding))) { throw base.CreateUnknownTypeException(o); } base.WriteStartElement(n, ns, o, false, null); if (needType) { base.WriteXsiType("Soap12OperationBinding", "http://schemas.xmlsoap.org/wsdl/soap12/"); } if (o.Required) { base.WriteAttribute("required", "http://schemas.xmlsoap.org/wsdl/", XmlConvert.ToString(o.Required)); } base.WriteAttribute("soapAction", "", o.SoapAction); if (o.Style != SoapBindingStyle.Default) { base.WriteAttribute("style", "", this.Write82_SoapBindingStyle(o.Style)); } if (o.SoapActionRequired) { base.WriteAttribute("soapActionRequired", "", XmlConvert.ToString(o.SoapActionRequired)); } base.WriteEndElement(o); } }
protected override SoapOperationBinding CreateSoapOperationBinding(SoapBindingStyle style, string action) { Soap12OperationBinding soapOperation = new Soap12OperationBinding(); soapOperation.SoapAction = action; soapOperation.Style = style; soapOperation.Method = SoapMethod; DealWithAmbiguity(action, SoapMethod.requestElementName.ToString(), soapOperation); return soapOperation; }
private void CheckOperationDuplicates(Soap12OperationBinding operation) { // we require soap action if we can't route on request element if (operation.DuplicateByRequestElement != null) { // except if we also can't route on soap action, which is an error if (operation.DuplicateBySoapAction != null) throw new InvalidOperationException(Res.GetString(Res.TheMethodsAndUseTheSameRequestElementAndSoapActionXmlns6, operation.Method.name, operation.DuplicateByRequestElement.Method.name, operation.Method.requestElementName.Name, operation.Method.requestElementName.Namespace, operation.DuplicateBySoapAction.Method.name, operation.Method.action)); else operation.SoapActionRequired = true; } else operation.SoapActionRequired = false; }
private void DealWithAmbiguity(string action, string requestElement, Soap12OperationBinding operation) { Soap12OperationBinding duplicateActionOperation = (Soap12OperationBinding)actions[action]; if (duplicateActionOperation != null) { operation.DuplicateBySoapAction = duplicateActionOperation; duplicateActionOperation.DuplicateBySoapAction = operation; CheckOperationDuplicates(duplicateActionOperation); } else actions[action] = operation; Soap12OperationBinding duplicateRequestElementOperation = (Soap12OperationBinding)requestElements[requestElement]; if (duplicateRequestElementOperation != null) { operation.DuplicateByRequestElement = duplicateRequestElementOperation; duplicateRequestElementOperation.DuplicateByRequestElement = operation; CheckOperationDuplicates(duplicateRequestElementOperation); } else requestElements[requestElement] = operation; CheckOperationDuplicates(operation); }
private void DealWithAmbiguity(string action, string requestElement, Soap12OperationBinding operation) { Soap12OperationBinding binding = (Soap12OperationBinding) this.actions[action]; if (binding != null) { operation.DuplicateBySoapAction = binding; binding.DuplicateBySoapAction = operation; this.CheckOperationDuplicates(binding); } else { this.actions[action] = operation; } Soap12OperationBinding binding2 = (Soap12OperationBinding) this.requestElements[requestElement]; if (binding2 != null) { operation.DuplicateByRequestElement = binding2; binding2.DuplicateByRequestElement = operation; this.CheckOperationDuplicates(binding2); } else { this.requestElements[requestElement] = operation; } this.CheckOperationDuplicates(operation); }
protected override SoapOperationBinding CreateSoapOperationBinding(SoapBindingStyle style, string action) { Soap12OperationBinding operation = new Soap12OperationBinding { SoapAction = action, Style = style, Method = base.SoapMethod }; this.DealWithAmbiguity(action, base.SoapMethod.requestElementName.ToString(), operation); return operation; }