本文整理汇总了C#中System.Web.Services.Description.ServiceDescriptionCollection类的典型用法代码示例。如果您正苦于以下问题:C# ServiceDescriptionCollection类的具体用法?C# ServiceDescriptionCollection怎么用?C# ServiceDescriptionCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServiceDescriptionCollection类属于System.Web.Services.Description命名空间,在下文中一共展示了ServiceDescriptionCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddSchemaImports
private void AddSchemaImports(XmlSchemas schemas, string uri, ServiceDescriptionCollection descriptions)
{
int num = 0;
foreach (XmlSchema schema in schemas)
{
if (schema != null)
{
if ((schema.Id == null) || (schema.Id.Length == 0))
{
schema.Id = "schema" + ++num.ToString(CultureInfo.InvariantCulture);
}
string location = uri + "?schema=" + schema.Id;
foreach (ServiceDescription description in descriptions)
{
if (description.Types.Schemas.Count == 0)
{
XmlSchema schema2 = new XmlSchema {
TargetNamespace = description.TargetNamespace
};
schema.ElementFormDefault = XmlSchemaForm.Qualified;
this.AddExternal(schema2, schema.TargetNamespace, location);
description.Types.Schemas.Add(schema2);
}
else
{
this.AddExternal(description.Types.Schemas[0], schema.TargetNamespace, location);
}
}
this.schemaTable.Add(schema.Id, schema);
}
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:32,代码来源:DiscoveryServerType.cs
示例2: CheckConformance
public static bool CheckConformance (WsiClaims claims, ServiceDescription service, BasicProfileViolationCollection violations)
{
ServiceDescriptionCollection col = new ServiceDescriptionCollection ();
col.Add (service);
ConformanceCheckContext ctx = new ConformanceCheckContext (col, violations);
return Check (claims, ctx, col);
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:WebServicesInteroperability.cs
示例3: NotImplementedException
void IWsdlImportExtension.BeforeImport (
ServiceDescriptionCollection wsdlDocuments,
XmlSchemaSet xmlSchemas,
ICollection<XmlElement> policy)
{
throw new NotImplementedException ();
}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:MessageEncodingBindingElementImporter.cs
示例4: ServiceDescriptionImporter
public ServiceDescriptionImporter ()
{
protocolName = String.Empty;
schemas = new XmlSchemas ();
serviceDescriptions = new ServiceDescriptionCollection ();
serviceDescriptions.SetImporter (this);
style = ServiceDescriptionImportStyle.Client;
}
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:ServiceDescriptionImporter.cs
示例5:
void IWsdlImportExtension.BeforeImport (
ServiceDescriptionCollection wsdlDocuments,
XmlSchemaSet xmlSchemas,
ICollection<XmlElement> policy)
{
if (!Enabled)
return;
impl.BeforeImport (wsdlDocuments, xmlSchemas, policy);
}
开发者ID:nlhepler,项目名称:mono,代码行数:10,代码来源:DataContractSerializerMessageContractImporter.cs
示例6: EnumerateDocumentedItems
internal static void EnumerateDocumentedItems(ServiceDescriptionCollection wsdls, Dictionary<string, string> documentedItems)
{
foreach (ServiceDescription wsdl in wsdls)
{
foreach (XmlSchema schema in wsdl.Types.Schemas)
{
EnumerateDocumentedItems(schema.Items, documentedItems);
}
}
}
开发者ID:anukat2015,项目名称:sones,代码行数:10,代码来源:WsdlUtils.cs
示例7: GetServiceDescriptions
public static ServiceDescriptionCollection GetServiceDescriptions(DiscoveryClientProtocol protocol)
{
ServiceDescriptionCollection services = new ServiceDescriptionCollection();
protocol.ResolveOneLevel();
foreach (DictionaryEntry entry in protocol.References) {
ContractReference contractRef = entry.Value as ContractReference;
if (contractRef != null) {
services.Add(contractRef.Contract);
}
}
return services;
}
开发者ID:AdamLStevenson,项目名称:SharpDevelop,代码行数:13,代码来源:ServiceReferenceHelper.cs
示例8: Add
public void Add(ServiceDescriptionCollection serviceDescriptions)
{
if (serviceDescriptions.Count == 0) {
return;
}
webServicesListView.BeginUpdate();
try {
foreach (ServiceDescription description in serviceDescriptions) {
Add(description);
}
} finally {
webServicesListView.EndUpdate();
}
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:15,代码来源:WebServicesView.cs
示例9: FindRootDescription
public static ServiceDescription FindRootDescription(ServiceDescriptionCollection wsdls)
{
ServiceDescription rootDescription = null;
//Find the "root" service description
foreach (System.Web.Services.Description.ServiceDescription description in wsdls)
{
if (description.Services.Count > 0)
{
rootDescription = description.Services[0].ServiceDescription;
break;
}
}
return rootDescription;
}
开发者ID:anukat2015,项目名称:sones,代码行数:15,代码来源:WsdlUtils.cs
示例10: AddDocument
internal static void AddDocument(string path, object document, XmlSchemas schemas, ServiceDescriptionCollection descriptions, StringCollection warnings)
{
ServiceDescription serviceDescription = document as ServiceDescription;
if (serviceDescription != null)
{
descriptions.Add(serviceDescription);
}
else
{
XmlSchema schema = document as XmlSchema;
if (schema != null)
{
schemas.Add(schema);
}
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:ServiceDescriptionImporter.cs
示例11: ServiceDescriptionImporter
public ServiceDescriptionImporter()
{
this.serviceDescriptions = new ServiceDescriptionCollection();
this.schemas = new XmlSchemas();
this.allSchemas = new XmlSchemas();
this.options = System.Xml.Serialization.CodeGenerationOptions.GenerateOldAsync;
this.abstractSchemas = new XmlSchemas();
this.concreteSchemas = new XmlSchemas();
Type[] protocolImporterTypes = WebServicesSection.Current.ProtocolImporterTypes;
this.importers = new ProtocolImporter[protocolImporterTypes.Length];
for (int i = 0; i < this.importers.Length; i++)
{
this.importers[i] = (ProtocolImporter) Activator.CreateInstance(protocolImporterTypes[i]);
this.importers[i].Initialize(this);
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:ServiceDescriptionImporter.cs
示例12: EnumerateWsdlsAndSchemas
private void EnumerateWsdlsAndSchemas(ServiceDescriptionCollection wsdls, XmlSchemaSet xsds)
{
ServiceDescription rootDescription = WsdlUtils.FindRootDescription(wsdls);
int num = 0;
foreach (ServiceDescription description2 in wsdls)
{
string key = "wsdl";
if (description2 != rootDescription)
{
key = key + "=wsdl" + num++;
}
queryFromDoc.Add(description2, key);
}
int num2 = 0;
foreach (XmlSchema schema in xsds.Schemas())
{
string str2 = "xsd=xsd" + num2++;
queryFromDoc.Add(schema, str2);
}
}
开发者ID:anukat2015,项目名称:sones,代码行数:21,代码来源:LocationOverrideExporter.cs
示例13: AddDocument
private void AddDocument(string path, object document, XmlSchemas schemas, ServiceDescriptionCollection descriptions)
{
ServiceDescription serviceDescription = document as ServiceDescription;
if (serviceDescription != null)
{
if (descriptions[serviceDescription.TargetNamespace] == null)
{
descriptions.Add(serviceDescription);
StringWriter w = new StringWriter();
XmlTextWriter writer = new XmlTextWriter(w);
writer.Formatting = Formatting.Indented;
serviceDescription.Write(writer);
this.wsdls.Add(w.ToString());
}
else
{
this.CheckPoint(MessageType.Warning, string.Format(duplicateService, serviceDescription.TargetNamespace, path));
}
}
else
{
XmlSchema schema = document as XmlSchema;
if (schema != null)
{
if (schemas[schema.TargetNamespace] == null)
{
schemas.Add(schema);
StringWriter writer3 = new StringWriter();
XmlTextWriter writer4 = new XmlTextWriter(writer3);
writer4.Formatting = Formatting.Indented;
schema.Write(writer4);
this.xsds.Add(writer3.ToString());
}
else
{
this.CheckPoint(MessageType.Warning, string.Format(duplicateSchema, serviceDescription.TargetNamespace, path));
}
}
}
}
开发者ID:hdougie,项目名称:webservicestudio2,代码行数:40,代码来源:Wsdl.cs
示例14: Reflect
public void Reflect(Type type, string url)
{
this.serviceType = type;
this.serviceUrl = url;
this.serviceAttr = WebServiceReflector.GetAttribute(type);
this.methods = WebMethodReflector.GetMethods(type);
this.CheckForDuplicateMethods(this.methods);
this.descriptionsWithPost = this.descriptions;
this.schemasWithPost = this.schemas;
if (this.reflectorsWithPost != null)
{
this.ReflectInternal(this.reflectorsWithPost);
this.descriptions = new ServiceDescriptionCollection();
this.schemas = new XmlSchemas();
}
this.ReflectInternal(this.reflectors);
if ((this.serviceAttr.Description != null) && (this.serviceAttr.Description.Length > 0))
{
this.ServiceDescription.Documentation = this.serviceAttr.Description;
}
this.ServiceDescription.Types.Schemas.Compile(null, false);
if (this.ServiceDescriptions.Count > 1)
{
this.Schemas.Add(this.ServiceDescription.Types.Schemas);
this.ServiceDescription.Types.Schemas.Clear();
}
else if (this.ServiceDescription.Types.Schemas.Count > 0)
{
XmlSchema[] array = new XmlSchema[this.ServiceDescription.Types.Schemas.Count];
this.ServiceDescription.Types.Schemas.CopyTo(array, 0);
foreach (XmlSchema schema in array)
{
if (XmlSchemas.IsDataSet(schema))
{
this.ServiceDescription.Types.Schemas.Remove(schema);
this.Schemas.Add(schema);
}
}
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:40,代码来源:ServiceDescriptionReflector.cs
示例15: Generate
public static void Generate (ArrayList services, ArrayList schemas, string binOper, string protocol)
{
ServiceDescriptionCollection descCol = new ServiceDescriptionCollection ();
foreach (ServiceDescription sd in services)
descCol.Add (sd);
XmlSchemas schemaCol;
if (schemas.Count > 0) {
schemaCol = new XmlSchemas ();
foreach (XmlSchema sc in schemas)
schemaCol.Add (sc);
}
else
schemaCol = descCol[0].Types.Schemas;
string oper, bin = null;
int i = binOper.IndexOf ('/');
if (i != -1) {
oper = binOper.Substring (i+1);
bin = binOper.Substring (0,i);
}
else
oper = binOper;
ConsoleSampleGenerator sg = new ConsoleSampleGenerator (descCol, schemaCol);
string req, resp;
sg.GenerateMessages (oper, bin, protocol, out req, out resp);
Console.WriteLine ();
Console.WriteLine ("Sample request message:");
Console.WriteLine ();
Console.WriteLine (req);
Console.WriteLine ();
Console.WriteLine ("Sample response message:");
Console.WriteLine ();
Console.WriteLine (resp);
}
开发者ID:Zman0169,项目名称:mono,代码行数:40,代码来源:SampleGenerator.cs
示例16: FixImportAddresses
private void FixImportAddresses(ServiceDescriptionCollection wsdls, ServiceDescription wsdlDoc, XmlSchemaSet schemas)
{
foreach (Import import in wsdlDoc.Imports)
{
if (string.IsNullOrEmpty(import.Location))
{
ServiceDescription description = wsdls[import.Namespace ?? string.Empty];
if (description != null)
{
string query = queryFromDoc[description];
import.Location = this.location + "?" + query;
}
}
}
if (wsdlDoc.Types != null)
{
foreach (XmlSchema schema in wsdlDoc.Types.Schemas)
{
this.FixImportAddresses(schemas, schema);
}
}
}
开发者ID:anukat2015,项目名称:sones,代码行数:22,代码来源:LocationOverrideExporter.cs
示例17: WsdlImporter
public WsdlImporter (
MetadataSet metadata,
IEnumerable<IPolicyImportExtension> policyImportExtensions,
IEnumerable<IWsdlImportExtension> wsdlImportExtensions)
: base (policyImportExtensions)
{
if (metadata == null)
throw new ArgumentNullException ("metadata");
if (wsdlImportExtensions == null) {
wsdl_extensions = new KeyedByTypeCollection<IWsdlImportExtension> ();
wsdl_extensions.Add (new DataContractSerializerMessageContractImporter ());
wsdl_extensions.Add (new XmlSerializerMessageContractImporter ());
//wsdl_extensions.Add (new MessageEncodingBindingElementImporter ());
wsdl_extensions.Add (new TransportBindingElementImporter ());
wsdl_extensions.Add (new StandardBindingImporter ());
} else {
wsdl_extensions = new KeyedByTypeCollection<IWsdlImportExtension> (wsdlImportExtensions);
}
// It is okay to fill these members immediately when WsdlImporter.ctor() is invoked
// i.e. after this .ctor(), those metadata docs are not considered anymore.
this.metadata = metadata;
this.wsdl_documents = new ServiceDescriptionCollection ();
this.xmlschemas = new XmlSchemaSet ();
this.policies = new List<XmlElement> ();
foreach (MetadataSection ms in metadata.MetadataSections) {
if (ms.Dialect == MetadataSection.ServiceDescriptionDialect &&
ms.Metadata.GetType () == typeof (WSServiceDescription))
wsdl_documents.Add ((WSServiceDescription) ms.Metadata);
else
if (ms.Dialect == MetadataSection.XmlSchemaDialect &&
ms.Metadata.GetType () == typeof (XmlSchema))
xmlschemas.Add ((XmlSchema) ms.Metadata);
}
}
开发者ID:carrie901,项目名称:mono,代码行数:38,代码来源:WsdlImporter.cs
示例18: ImportBinding
void ImportBinding (ServiceDescription desc, Service service, TypeStubInfo typeInfo, string url, BindingInfo binfo)
{
port = new Port ();
port.Name = portNames.AddUnique (binfo.Name, port);
bool bindingFull = true;
if (binfo.Namespace != desc.TargetNamespace)
{
if (binfo.Location == null || binfo.Location == string.Empty)
{
ServiceDescription newDesc = new ServiceDescription();
newDesc.TargetNamespace = binfo.Namespace;
newDesc.Name = binfo.Name;
bindingFull = ImportBindingContent (newDesc, typeInfo, url, binfo);
if (bindingFull) {
int id = ServiceDescriptions.Add (newDesc);
AddImport (desc, binfo.Namespace, GetWsdlUrl (url,id));
}
}
else {
AddImport (desc, binfo.Namespace, binfo.Location);
bindingFull = true;
}
}
else
bindingFull = ImportBindingContent (desc, typeInfo, url, binfo);
if (bindingFull)
{
port.Binding = new XmlQualifiedName (binding.Name, binfo.Namespace);
int n = 0;
string name = binfo.Name;
bool found;
do {
found = false;
foreach (Port p in service.Ports)
if (p.Name == name) { found = true; n++; name = binfo.Name + n; break; }
}
while (found);
port.Name = name;
service.Ports.Add (port);
}
if (binfo.WebServiceBindingAttribute != null && binfo.WebServiceBindingAttribute.ConformsTo != WsiProfiles.None && String.IsNullOrEmpty (binfo.WebServiceBindingAttribute.Name)) {
BasicProfileViolationCollection violations = new BasicProfileViolationCollection ();
desc.Types.Schemas.Add (Schemas);
ServiceDescriptionCollection col = new ServiceDescriptionCollection ();
col.Add (desc);
ConformanceCheckContext ctx = new ConformanceCheckContext (col, violations);
ctx.ServiceDescription = desc;
ConformanceChecker[] checkers = WebServicesInteroperability.GetCheckers (binfo.WebServiceBindingAttribute.ConformsTo);
foreach (ConformanceChecker checker in checkers) {
ctx.Checker = checker;
WebServicesInteroperability.Check (ctx, checker, binding);
if (violations.Count > 0)
throw new InvalidOperationException (violations [0].ToString ());
}
}
}
开发者ID:Profit0004,项目名称:mono,代码行数:61,代码来源:ProtocolReflector.cs
示例19: SetParent
internal void SetParent(ServiceDescriptionCollection parent) {
this.parent = parent;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:3,代码来源:ServiceDescription.cs
示例20: FillItems
void FillItems(ServiceDescriptionCollection descriptions)
{
foreach (ServiceDescription element in descriptions) {
Add(element);
}
}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:6,代码来源:AddServiceReferenceViewModel.cs
注:本文中的System.Web.Services.Description.ServiceDescriptionCollection类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论