本文整理汇总了C#中System.Web.Services.Description类的典型用法代码示例。如果您正苦于以下问题:C# System.Web.Services.Description类的具体用法?C# System.Web.Services.Description怎么用?C# System.Web.Services.Description使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System.Web.Services.Description类属于命名空间,在下文中一共展示了System.Web.Services.Description类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: WsdlContractConversionContext
internal WsdlContractConversionContext(ContractDescription contract, WsdlNS.PortType wsdlPortType)
{
this.contract = contract;
this.wsdlPortType = wsdlPortType;
this.wsdlOperations = new Dictionary<OperationDescription, WsdlNS.Operation>();
this.operationDescriptions = new Dictionary<WsdlNS.Operation, OperationDescription>();
this.wsdlOperationMessages = new Dictionary<MessageDescription, WsdlNS.OperationMessage>();
this.messageDescriptions = new Dictionary<WsdlNS.OperationMessage, MessageDescription>();
this.wsdlOperationFaults = new Dictionary<FaultDescription, WsdlNS.OperationFault>();
this.faultDescriptions = new Dictionary<WsdlNS.OperationFault, FaultDescription>();
this.operationBindings = new Dictionary<WsdlNS.Operation, Collection<WsdlNS.OperationBinding>>();
}
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:14,代码来源:WsdlContractConversionContext.cs
示例2: WsdlEndpointConversionContext
internal WsdlEndpointConversionContext(WsdlEndpointConversionContext bindingContext, ServiceEndpoint endpoint, WsdlNS.Port wsdlport)
{
this.endpoint = endpoint;
this.wsdlBinding = bindingContext.WsdlBinding;
this.wsdlPort = wsdlport;
this.contractContext = bindingContext.contractContext;
this.wsdlOperationBindings = bindingContext.wsdlOperationBindings;
this.operationDescriptionBindings = bindingContext.operationDescriptionBindings;
this.wsdlMessageBindings = bindingContext.wsdlMessageBindings;
this.messageDescriptionBindings = bindingContext.messageDescriptionBindings;
this.wsdlFaultBindings = bindingContext.wsdlFaultBindings;
this.faultDescriptionBindings = bindingContext.faultDescriptionBindings;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:15,代码来源:WsdlEndpointConversionContext.cs
示例3: BeforeImport
public void BeforeImport(WsdlNS.ServiceDescriptionCollection wsdlDocuments, Xml.Schema.XmlSchemaSet xmlSchemas, ICollection<Xml.XmlElement> policy)
{
foreach (WsdlNS.ServiceDescription wsdl in wsdlDocuments)
{
if (wsdl != null)
{
foreach (WsdlNS.Binding wsdlBinding in wsdl.Bindings)
{
if (wsdlBinding != null && wsdlBinding.Extensions != null)
{
WsdlNS.SoapBinding soapBinding = (WsdlNS.SoapBinding)wsdlBinding.Extensions.Find(typeof(WsdlNS.SoapBinding));
if (soapBinding != null)
{
string transportUri = soapBinding.Transport;
if (!string.IsNullOrEmpty(transportUri) && transportUri.Equals(UdpConstants.WsdlSoapUdpTransportUri, StringComparison.Ordinal))
{
WsdlImporter.SoapInPolicyWorkaroundHelper.InsertAdHocPolicy(wsdlBinding, soapBinding.Transport, this.udpTransportUriKey);
}
}
}
}
}
}
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:24,代码来源:UdpTransportImporter.cs
示例4: AssertPolicy
public static PolicyAssertionCollection AssertPolicy (
WS.Binding binding, TestLabel label)
{
label.EnterScope ("FindPolicy");
XmlElement policy = null;
foreach (var extension in binding.Extensions) {
var xml = extension as XmlElement;
if (xml == null)
continue;
Assert.That (policy, Is.Null, label.Get ());
policy = xml;
}
Assert.That (policy, Is.Not.Null, label.Get ());
try {
return AssertPolicy (binding.ServiceDescription, policy, label);
} finally {
label.LeaveScope ();
}
}
开发者ID:,项目名称:,代码行数:20,代码来源:
示例5: AddToMetadataIfNotNull
void AddToMetadataIfNotNull(WSDescription.ServiceDescription serviceDescription)
{
if (serviceDescription != null) {
AddMetadataSection(MetadataSection.ServiceDescriptionDialect, serviceDescription);
}
}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:6,代码来源:WebServiceMetadataSet.cs
示例6: ExportMessageBodyBinding
void ExportMessageBodyBinding(MessageDescription messageDescription, bool isRpc, bool isEncoded, WsdlNS.MessageBinding messageBinding)
{
WsdlNS.SoapBodyBinding bodyBinding = SoapHelper.GetOrCreateSoapBodyBinding(endpointContext, messageBinding, exporter);
if (bodyBinding == null)
return;
bodyBinding.Use = isEncoded ? WsdlNS.SoapBindingUse.Encoded : WsdlNS.SoapBindingUse.Literal;
if (isRpc)
{
string ns;
if (!ExportedMessages.WrapperNamespaces.TryGetValue(new MessageDescriptionDictionaryKey(endpointContext.ContractConversionContext.Contract, messageDescription), out ns))
ns = messageDescription.Body.WrapperNamespace;
bodyBinding.Namespace = ns;
}
if (isEncoded)
bodyBinding.Encoding = XmlSerializerOperationFormatter.GetEncoding(soapVersion);
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:18,代码来源:MessageContractExporter.cs
示例7: ExportMessagePart
protected void ExportMessagePart(WsdlNS.Message message, MessagePartDescription part, XmlQualifiedName typeName, XmlSchemaType xsdType, bool isOptional, bool isNillable, bool skipSchemaExport, bool generateElement, string wrapperNs, XmlSchemaSequence wrapperSequence, XmlSchemaSet schemaSet)
{
if (IsNullOrEmpty(typeName) && xsdType == null)
return;
#if DEBUG
if (xsdType == null)
Fx.Assert(NamingHelper.IsValidNCName(typeName.Name), "Name value has to be a valid NCName.");
#endif
string elementName = part.Name;
string partName = string.IsNullOrEmpty(part.UniquePartName) ? elementName : part.UniquePartName;
WsdlNS.MessagePart wsdlPart = null;
if (generateElement)
{
if (wrapperSequence != null)
{
if (!skipSchemaExport)
ExportLocalElement(wrapperNs, partName, part.Namespace, typeName, xsdType, part.Multiple, isOptional, isNillable, wrapperSequence, schemaSet);
}
else
{
if (!skipSchemaExport)
ExportGlobalElement(elementName, part.Namespace, isNillable, typeName, xsdType, schemaSet);
wsdlPart = AddMessagePart(message, partName, new XmlQualifiedName(elementName, part.Namespace), XmlQualifiedName.Empty);
}
}
else
{
if (String.IsNullOrEmpty(typeName.Name))
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxAnonymousTypeNotSupported, message.Name, partName)));
wsdlPart = AddMessagePart(message, partName, XmlQualifiedName.Empty, typeName);
}
if (wsdlPart != null)
{
part.UniquePartName = wsdlPart.Name;
}
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:38,代码来源:MessageContractExporter.cs
示例8: CreateHeaderMessage
protected bool CreateHeaderMessage(MessageDescription message, out WsdlNS.Message wsdlMessage)
{
wsdlMessage = null;
if (ExportedMessages.WsdlHeaderMessages.ContainsKey(new MessageDescriptionDictionaryKey(contractContext.Contract, message)))
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(SR.GetString(SR.MultipleCallsToExportContractWithSameContract)));
TypedMessageKey typedMessageKey = null;
if (message.IsTypedMessage)
{
typedMessageKey = new TypedMessageKey(message.MessageType, operation.DeclaringContract.Namespace, GetExtensionData());
if (ExportedMessages.TypedHeaderMessages.TryGetValue(typedMessageKey, out wsdlMessage))
{
this.ExportedMessages.WsdlHeaderMessages.Add(new MessageDescriptionDictionaryKey(contractContext.Contract, message), wsdlMessage);
return false;
}
}
string messageName = GetHeaderMessageName(message);
wsdlMessage = new WsdlNS.Message();
wsdlMessage.Name = messageName;
contractContext.WsdlPortType.ServiceDescription.Messages.Add(wsdlMessage);
if (message.IsTypedMessage)
ExportedMessages.TypedHeaderMessages.Add(typedMessageKey, wsdlMessage);
this.ExportedMessages.WsdlHeaderMessages.Add(new MessageDescriptionDictionaryKey(contractContext.Contract, message), wsdlMessage);
return true;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:29,代码来源:MessageContractExporter.cs
示例9: GetUniqueMessageName
string GetUniqueMessageName(WsdlNS.ServiceDescription wsdl, string messageNameBase)
{
return NamingHelper.GetUniqueName(messageNameBase, DoesMessageNameExist, wsdl);
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:4,代码来源:MessageContractExporter.cs
示例10: ExportAnyMessage
void ExportAnyMessage(WsdlNS.Message message, MessagePartDescription part)
{
XmlSchemaSet schemas = this.exporter.GeneratedXmlSchemas;
XmlSchema schema = SchemaHelper.GetSchema(DataContractSerializerMessageContractImporter.GenericMessageTypeName.Namespace, schemas);
if (!schema.SchemaTypes.Contains(DataContractSerializerMessageContractImporter.GenericMessageTypeName))
{
XmlSchemaComplexType genericMessageType = new XmlSchemaComplexType();
genericMessageType.Name = DataContractSerializerMessageContractImporter.GenericMessageTypeName.Name;
XmlSchemaSequence bodySequence = new XmlSchemaSequence();
genericMessageType.Particle = bodySequence;
XmlSchemaAny anyElement = new XmlSchemaAny();
anyElement.MinOccurs = 0;
anyElement.MaxOccurs = decimal.MaxValue;
anyElement.Namespace = "##any";
bodySequence.Items.Add(anyElement);
SchemaHelper.AddTypeToSchema(genericMessageType, schema, schemas);
}
string partName = string.IsNullOrEmpty(part.UniquePartName) ? part.Name : part.UniquePartName;
WsdlNS.MessagePart wsdlPart = AddMessagePart(message, partName, XmlQualifiedName.Empty, DataContractSerializerMessageContractImporter.GenericMessageTypeName);
part.UniquePartName = wsdlPart.Name;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:25,代码来源:MessageContractExporter.cs
示例11: ExportFaultBinding
void ExportFaultBinding(FaultDescription fault, bool isEncoded, WsdlNS.OperationBinding operationBinding)
{
SoapHelper.CreateSoapFaultBinding(fault.Name, endpointContext, endpointContext.GetFaultBinding(fault), isEncoded);
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:4,代码来源:MessageContractExporter.cs
示例12: ExportStreamBody
protected void ExportStreamBody(WsdlNS.Message message, string wrapperName, string wrapperNs, string partName, string partNs, bool isRpc, bool skipSchemaExport)
{
XmlSchemaSet schemas = this.exporter.GeneratedXmlSchemas;
XmlSchema schema = SchemaHelper.GetSchema(DataContractSerializerMessageContractImporter.StreamBodyTypeName.Namespace, schemas);
if (!schema.SchemaTypes.Contains(DataContractSerializerMessageContractImporter.StreamBodyTypeName))
{
XmlSchemaSimpleType streamBodyType = new XmlSchemaSimpleType();
streamBodyType.Name = DataContractSerializerMessageContractImporter.StreamBodyTypeName.Name;
XmlSchemaSimpleTypeRestriction contentRestriction = new XmlSchemaSimpleTypeRestriction();
contentRestriction.BaseTypeName = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Base64Binary).QualifiedName;
streamBodyType.Content = contentRestriction;
SchemaHelper.AddTypeToSchema(streamBodyType, schema, schemas);
}
XmlSchemaSequence wrapperSequence = null;
if (!isRpc && wrapperName != null)
wrapperSequence = ExportWrappedPart(message, wrapperName, wrapperNs, schemas, skipSchemaExport);
MessagePartDescription streamPart = new MessagePartDescription(partName, partNs);
ExportMessagePart(message, streamPart, DataContractSerializerMessageContractImporter.StreamBodyTypeName, null/*xsdType*/, false/*isOptional*/, false/*isNillable*/, skipSchemaExport, !isRpc, wrapperNs, wrapperSequence, schemas);
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:19,代码来源:MessageContractExporter.cs
示例13: ExportMessageHeaderBinding
void ExportMessageHeaderBinding(MessageHeaderDescription header, XmlQualifiedName messageName, bool isEncoded, WsdlNS.MessageBinding messageBinding)
{
#if DEBUG
Fx.Assert(NamingHelper.IsValidNCName(messageName.Name), "Name value has to be a valid NCName.");
#endif
WsdlNS.SoapHeaderBinding headerBinding = SoapHelper.CreateSoapHeaderBinding(endpointContext, messageBinding);
headerBinding.Part = string.IsNullOrEmpty(header.UniquePartName) ? header.Name : header.UniquePartName;
headerBinding.Message = messageName;
headerBinding.Use = isEncoded ? WsdlNS.SoapBindingUse.Encoded : WsdlNS.SoapBindingUse.Literal;
if (isEncoded)
headerBinding.Encoding = XmlSerializerOperationFormatter.GetEncoding(soapVersion);
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:12,代码来源:MessageContractExporter.cs
示例14: AddMessagePart
static protected WsdlNS.MessagePart AddMessagePart(WsdlNS.Message message, string partName, XmlQualifiedName elementName, XmlQualifiedName typeName)
{
if (message.Parts[partName] != null)
{
if (IsNullOrEmpty(elementName))
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(SR.GetString(SR.SFxPartNameMustBeUniqueInRpc, partName)));
int i = 1;
while (message.Parts[partName + i] != null)
{
if (i == Int32.MaxValue)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(SR.GetString(SR.SFxTooManyPartsWithSameName, partName)));
i++;
}
partName = partName + i.ToString(CultureInfo.InvariantCulture);
}
WsdlNS.MessagePart part = new WsdlNS.MessagePart();
part.Name = partName;
part.Element = elementName;
part.Type = typeName;
message.Parts.Add(part);
EnsureXsdImport(IsNullOrEmpty(elementName) ? typeName.Namespace : elementName.Namespace, message.ServiceDescription);
return part;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:23,代码来源:MessageContractExporter.cs
示例15: ResolvePolicy
static XmlElement ResolvePolicy (WS.ServiceDescription sd, XmlElement policy)
{
if (policy.LocalName.Equals ("Policy"))
return policy;
var uri = policy.GetAttribute ("URI");
if (!uri.StartsWith ("#"))
return null;
foreach (var sext in sd.Extensions) {
var sxml = sext as XmlElement;
if (sxml == null)
continue;
if (!sxml.NamespaceURI.Equals (WspNamespace))
continue;
if (!sxml.LocalName.Equals ("Policy"))
continue;
var id = sxml.GetAttribute ("Id", WsuNamespace);
if (uri.Substring (1).Equals (id))
return sxml;
}
return null;
}
开发者ID:,项目名称:,代码行数:24,代码来源:
示例16: EnsureXsdImport
static void EnsureXsdImport(string ns, WsdlNS.ServiceDescription wsdl)
{
string refNs = wsdl.TargetNamespace;
if (!refNs.EndsWith("/", StringComparison.Ordinal))
refNs = refNs + "/Imports";
else
refNs += "Imports";
if (refNs == ns)
refNs = wsdl.TargetNamespace;
XmlSchema xsd = GetContainedSchema(wsdl, refNs);
if (xsd != null)
{
foreach (object include in xsd.Includes)
{
XmlSchemaImport import = include as XmlSchemaImport;
if (import != null && SchemaHelper.NamespacesEqual(import.Namespace, ns))
return;
}
}
else
{
xsd = new XmlSchema();
xsd.TargetNamespace = refNs;
wsdl.Types.Schemas.Add(xsd);
}
XmlSchemaImport imp = new XmlSchemaImport();
if (ns != null && ns.Length > 0)
imp.Namespace = ns;
xsd.Includes.Add(imp);
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:32,代码来源:MessageContractExporter.cs
示例17: GetContainedSchema
static XmlSchema GetContainedSchema(WsdlNS.ServiceDescription wsdl, string ns)
{
foreach (XmlSchema xsd in wsdl.Types.Schemas)
if (SchemaHelper.NamespacesEqual(xsd.TargetNamespace, ns))
return xsd;
return null;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:MessageContractExporter.cs
示例18: BeforeImport
public void BeforeImport(WsdlNS.ServiceDescriptionCollection wsdlDocuments,
System.Xml.Schema.XmlSchemaSet xmlSchemas, ICollection<XmlElement> policy)
{
}
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:4,代码来源:UdpBindingElementImporter.cs
示例19: CreateMessage
protected bool CreateMessage(MessageDescription message, int messageIndex, out WsdlNS.Message wsdlMessage)
{
wsdlMessage = null;
bool isNewMessage = true;
if (ExportedMessages.WsdlMessages.ContainsKey(new MessageDescriptionDictionaryKey(contractContext.Contract, message)))
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(SR.GetString(SR.MultipleCallsToExportContractWithSameContract)));
TypedMessageKey typedMessageKey = null;
OperationMessageKey messageKey = null;
if (message.IsTypedMessage)
{
typedMessageKey = new TypedMessageKey(message.MessageType, operation.DeclaringContract.Namespace, this.GetExtensionData());
if (ExportedMessages.TypedMessages.TryGetValue(typedMessageKey, out wsdlMessage))
isNewMessage = false;
}
else if (operation.OperationMethod != null)
{
messageKey = new OperationMessageKey(operation, messageIndex);
if (ExportedMessages.ParameterMessages.TryGetValue(messageKey, out wsdlMessage))
isNewMessage = false;
}
WsdlNS.ServiceDescription wsdl = contractContext.WsdlPortType.ServiceDescription;
if (isNewMessage)
{
wsdlMessage = new WsdlNS.Message();
wsdlMessage.Name = GetMessageName(message);
wsdl.Messages.Add(wsdlMessage);
if (message.IsTypedMessage)
ExportedMessages.TypedMessages.Add(typedMessageKey, wsdlMessage);
else if (messageKey != null)
ExportedMessages.ParameterMessages.Add(messageKey, wsdlMessage);
}
//Add Name to OperationMessage
WsdlNS.OperationMessage wsdlOperationMessage = contractContext.GetOperationMessage(message);
wsdlOperationMessage.Message = new XmlQualifiedName(wsdlMessage.Name, wsdlMessage.ServiceDescription.TargetNamespace);
this.ExportedMessages.WsdlMessages.Add(new MessageDescriptionDictionaryKey(contractContext.Contract, message), wsdlMessage);
return isNewMessage;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:42,代码来源:MessageContractExporter.cs
示例20: CustomPolicyConversionContext
public CustomPolicyConversionContext (WS.Binding binding, ServiceEndpoint endpoint)
: base (endpoint)
{
this.binding = binding;
assertions = new PolicyAssertionCollection ();
binding_elements = ((CustomBinding)endpoint.Binding).Elements;
}
开发者ID:Profit0004,项目名称:mono,代码行数:7,代码来源:CustomPolicyConversionContext.cs
注:本文中的System.Web.Services.Description类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论