本文整理汇总了C#中System.Web.Services.Description.Binding.GetDocumentationElement方法的典型用法代码示例。如果您正苦于以下问题:C# Binding.GetDocumentationElement方法的具体用法?C# Binding.GetDocumentationElement怎么用?C# Binding.GetDocumentationElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Services.Description.Binding
的用法示例。
在下文中一共展示了Binding.GetDocumentationElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReflectBinding
void ReflectBinding(ReflectedBinding reflectedBinding) {
string bindingName = XmlConvert.EncodeLocalName(reflectedBinding.bindingAttr.Name);
string bindingNamespace = reflectedBinding.bindingAttr.Namespace;
if (bindingName.Length == 0) bindingName = Service.Name + ProtocolName;
if (bindingNamespace.Length == 0) bindingNamespace = ServiceDescription.TargetNamespace;
WsiProfiles claims = WsiProfiles.None;
if (reflectedBinding.bindingAttr.Location.Length > 0) {
// If a URL is specified for the WSDL, file, then we just import the
// binding from there instead of generating it in this WSDL file.
portType = null;
binding = null;
}
else {
bindingServiceDescription = GetServiceDescription(bindingNamespace);
CodeIdentifiers bindingNames = new CodeIdentifiers();
foreach (Binding b in bindingServiceDescription.Bindings)
bindingNames.AddReserved(b.Name);
bindingName = bindingNames.AddUnique(bindingName, binding);
portType = new PortType();
binding = new Binding();
portType.Name = bindingName;
binding.Name = bindingName;
binding.Type = new XmlQualifiedName(portType.Name, bindingNamespace);
claims = reflectedBinding.bindingAttr.ConformsTo & this.ConformsTo;
if (reflectedBinding.bindingAttr.EmitConformanceClaims && claims != WsiProfiles.None) {
ServiceDescription.AddConformanceClaims(binding.GetDocumentationElement(), claims);
}
bindingServiceDescription.Bindings.Add(binding);
bindingServiceDescription.PortTypes.Add(portType);
}
if (portNames == null) {
portNames = new CodeIdentifiers();
foreach (Port p in Service.Ports)
portNames.AddReserved(p.Name);
}
port = new Port();
port.Binding = new XmlQualifiedName(bindingName, bindingNamespace);
port.Name = portNames.AddUnique(bindingName, port);
Service.Ports.Add(port);
BeginClass();
if (reflectedBinding.methodList != null && reflectedBinding.methodList.Count > 0) {
foreach (LogicalMethodInfo method in reflectedBinding.methodList) {
MoveToMethod(method);
operation = new Operation();
operation.Name = XmlConvert.EncodeLocalName(method.Name);
if (methodAttr.Description != null && methodAttr.Description.Length > 0)
operation.Documentation = methodAttr.Description;
operationBinding = new OperationBinding();
operationBinding.Name = operation.Name;
inputMessage = null;
outputMessage = null;
headerMessages = null;
if (ReflectMethod()) {
if (inputMessage != null) bindingServiceDescription.Messages.Add(inputMessage);
if (outputMessage != null) bindingServiceDescription.Messages.Add(outputMessage);
if (headerMessages != null) {
foreach (Message headerMessage in headerMessages) {
bindingServiceDescription.Messages.Add(headerMessage);
}
}
binding.Operations.Add(operationBinding);
portType.Operations.Add(operation);
}
}
}
if (binding != null && claims == WsiProfiles.BasicProfile1_1 && ProtocolName == "Soap") {
BasicProfileViolationCollection warnings = new BasicProfileViolationCollection();
WebServicesInteroperability.AnalyzeBinding(binding, bindingServiceDescription, ServiceDescriptions, warnings);
if (warnings.Count > 0) {
throw new InvalidOperationException(Res.GetString(Res.WebWsiViolation, ServiceType.FullName, warnings.ToString()));
}
}
EndClass();
}