本文整理汇总了C#中System.Web.Services.Description.Binding类的典型用法代码示例。如果您正苦于以下问题:C# Binding类的具体用法?C# Binding怎么用?C# Binding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Binding类属于System.Web.Services.Description命名空间,在下文中一共展示了Binding类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WsdlEndpointConversionContext
internal WsdlEndpointConversionContext (WsdlContractConversionContext context, ServiceEndpoint endpoint, Port port, WSBinding wsdlBinding)
{
this.context = context;
this.endpoint = endpoint;
this.port = port;
this.wsdl_binding = wsdlBinding;
}
示例2: GetServiceType
static Type GetServiceType(Binding soapBinding, Assembly assembly)
{
foreach (var type in assembly.GetTypes())
{
var bindingAttribute = type.GetCustomAttributes(typeof (WebServiceBindingAttribute), false)
.Cast<WebServiceBindingAttribute>().SingleOrDefault();
if (bindingAttribute != null && bindingAttribute.Name == soapBinding.Name)
return type;
}
return null;
//var serviceTypes = new List<Type>();
//// FIXME: Best way to match the service/binding to the implementing type
////
//foreach (var type in assembly.GetTypes())
//{
// var bindingAttributes = type.GetCustomAttributes(typeof (WebServiceBindingAttribute), false);
// if (bindingAttributes.Length != 0) serviceTypes.Add(type);
//}
//var name = soapBinding.Type.Name;
//return string.IsNullOrEmpty(name)
// ? new Type[0]
// : serviceTypes.Where(t => t.Name == name || t.Name.EndsWith(name));
}
示例3: CustomPolicyConversionContext
public CustomPolicyConversionContext (WS.Binding binding, ServiceEndpoint endpoint)
: base (endpoint)
{
this.binding = binding;
assertions = new PolicyAssertionCollection ();
binding_elements = ((CustomBinding)endpoint.Binding).Elements;
}
示例4: GetListOfOperations
//DONE
//This method generates a list of operations from a web service description. Returns a list of the
//webservice's operations on success, and null on failure.
public string[] GetListOfOperations(string webServiceURL)
{
List<string> ListOfOperations = new List<string>();
WebClient webServiceClient = new WebClient();
Binding binding = new Binding();
try
{
Stream serviceStream = webServiceClient.OpenRead(webServiceURL + "?wsdl");
//This gets the WSDL file...
ServiceDescription webServiceDescription = ServiceDescription.Read(serviceStream);
//Get a list of operations from the web service description...
binding = webServiceDescription.Bindings[0];
OperationBindingCollection operationCollection = binding.Operations;
foreach (OperationBinding operation in operationCollection)
{
ListOfOperations.Add(operation.Name);
}
}
catch (Exception ex)
{
throw ex;
}
return ListOfOperations.ToArray();
}
示例5: BuildEntities
static List<ExplorerItem> BuildEntities(Type serviceType, Binding soapBinding)
{
var list = new List<ExplorerItem>();
foreach (var operation in GetSoapOperations(soapBinding))
list.Add(CreateExplorerOperation(serviceType, operation));
return list;
}
示例6: TestAddBinding
public void TestAddBinding ()
{
const string bindingName = "testBinding";
Binding b = new Binding ();
b.Name = bindingName;
bc.Add (b);
Assert.AreEqual (1, bc.Count);
Assert.AreEqual (b, bc[bindingName]);
}
示例7: FindOperation
OperationBinding FindOperation(Binding binding, string name)
{
foreach (OperationBinding oper in binding.Operations) {
if (oper.Input.Name != null) {
if (oper.Input.Name == name) return oper;
}
else
if (oper.Name == name) return oper;
}
return null;
}
示例8: GetServiceType
private static Type GetServiceType(Binding soapBinding, Assembly assembly)
{
foreach (var type in assembly.GetTypes())
{
var bindingAttribute = type.GetCustomAttributes(typeof (WebServiceBindingAttribute), false)
.Cast<WebServiceBindingAttribute>().SingleOrDefault();
if (bindingAttribute != null && bindingAttribute.Name == soapBinding.Name)
return type;
}
return null;
}
示例9: WsdlEndpointConversionContext
internal WsdlEndpointConversionContext(WsdlContractConversionContext contractContext, ServiceEndpoint endpoint, Binding wsdlBinding, Port wsdlport)
{
this.endpoint = endpoint;
this.wsdlBinding = wsdlBinding;
this.wsdlPort = wsdlport;
this.contractContext = contractContext;
this.wsdlOperationBindings = new Dictionary<OperationDescription, OperationBinding>();
this.operationDescriptionBindings = new Dictionary<OperationBinding, OperationDescription>();
this.wsdlMessageBindings = new Dictionary<MessageDescription, MessageBinding>();
this.messageDescriptionBindings = new Dictionary<MessageBinding, MessageDescription>();
this.wsdlFaultBindings = new Dictionary<FaultDescription, FaultBinding>();
this.faultDescriptionBindings = new Dictionary<FaultBinding, FaultDescription>();
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:WsdlEndpointConversionContext.cs
示例10: Check
internal static void Check (ConformanceCheckContext ctx, ConformanceChecker checker, Binding b)
{
checker.Check (ctx, b);
CheckExtensions (ctx, checker, b.Extensions);
foreach (OperationBinding oper in b.Operations) {
CheckExtensions (ctx, checker, oper.Extensions);
foreach (MessageBinding mb in oper.Faults) {
checker.Check (ctx, mb);
CheckExtensions (ctx, checker, mb.Extensions);
}
checker.Check (ctx, oper.Input);
CheckExtensions (ctx, checker, oper.Input.Extensions);
checker.Check (ctx, oper.Output);
CheckExtensions (ctx, checker, oper.Output.Extensions);
}
}
示例11: Remove
/// <include file='doc\ServiceDescription.uex' path='docs/doc[@for="BindingCollection.Remove"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public void Remove(Binding binding) {
List.Remove(binding);
}
示例12: Contains
/// <include file='doc\ServiceDescription.uex' path='docs/doc[@for="BindingCollection.Contains"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public bool Contains(Binding binding) {
return List.Contains(binding);
}
示例13: IndexOf
/// <include file='doc\ServiceDescription.uex' path='docs/doc[@for="BindingCollection.IndexOf"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public int IndexOf(Binding binding) {
return List.IndexOf(binding);
}
示例14: Insert
/// <include file='doc\ServiceDescription.uex' path='docs/doc[@for="BindingCollection.Insert"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public void Insert(int index, Binding binding) {
List.Insert(index, binding);
}
示例15: MoveToBinding
void MoveToBinding(Service service, Port port, Binding binding, PortType portType) {
this.service = service;
this.port = port;
this.portType = portType;
this.binding = binding;
this.encodedBinding = false;
}