本文整理汇总了C#中System.Web.Services.Protocols.LogicalMethodInfo类的典型用法代码示例。如果您正苦于以下问题:C# LogicalMethodInfo类的具体用法?C# LogicalMethodInfo怎么用?C# LogicalMethodInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LogicalMethodInfo类属于System.Web.Services.Protocols命名空间,在下文中一共展示了LogicalMethodInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetInitializers
internal static object[] GetInitializers(LogicalMethodInfo[] methodInfos)
{
if (methodInfos.Length == 0)
{
return new object[0];
}
WebServiceAttribute attribute = WebServiceReflector.GetAttribute(methodInfos);
bool serviceDefaultIsEncoded = SoapReflector.ServiceDefaultIsEncoded(WebServiceReflector.GetMostDerivedType(methodInfos));
XmlReflectionImporter importer = SoapReflector.CreateXmlImporter(attribute.Namespace, serviceDefaultIsEncoded);
WebMethodReflector.IncludeTypes(methodInfos, importer);
ArrayList list = new ArrayList();
bool[] flagArray = new bool[methodInfos.Length];
for (int i = 0; i < methodInfos.Length; i++)
{
LogicalMethodInfo methodInfo = methodInfos[i];
Type returnType = methodInfo.ReturnType;
if (IsSupported(returnType) && HttpServerProtocol.AreUrlParametersSupported(methodInfo))
{
XmlAttributes attributes = new XmlAttributes(methodInfo.ReturnTypeCustomAttributeProvider);
XmlTypeMapping mapping = importer.ImportTypeMapping(returnType, attributes.XmlRoot);
mapping.SetKey(methodInfo.GetKey() + ":Return");
list.Add(mapping);
flagArray[i] = true;
}
}
if (list.Count == 0)
{
return new object[0];
}
XmlMapping[] mappings = (XmlMapping[]) list.ToArray(typeof(XmlMapping));
Evidence evidenceForType = GetEvidenceForType(methodInfos[0].DeclaringType);
TraceMethod caller = Tracing.On ? new TraceMethod(typeof(XmlReturn), "GetInitializers", methodInfos) : null;
if (Tracing.On)
{
Tracing.Enter(Tracing.TraceId("TraceCreateSerializer"), caller, new TraceMethod(typeof(XmlSerializer), "FromMappings", new object[] { mappings, evidenceForType }));
}
XmlSerializer[] serializerArray = null;
if (AppDomain.CurrentDomain.IsHomogenous)
{
serializerArray = XmlSerializer.FromMappings(mappings);
}
else
{
serializerArray = XmlSerializer.FromMappings(mappings, evidenceForType);
}
if (Tracing.On)
{
Tracing.Exit(Tracing.TraceId("TraceCreateSerializer"), caller);
}
object[] objArray = new object[methodInfos.Length];
int num2 = 0;
for (int j = 0; j < objArray.Length; j++)
{
if (flagArray[j])
{
objArray[j] = serializerArray[num2++];
}
}
return objArray;
}
示例2: SoapServerMethod
public SoapServerMethod(Type serverType, LogicalMethodInfo methodInfo) {
this.methodInfo = methodInfo;
//
// Set up the XmlImporter, the SoapImporter, and acquire
// the ServiceAttribute on the serverType for use in
// creating a SoapReflectedMethod.
//
WebServiceAttribute serviceAttribute = WebServiceReflector.GetAttribute(serverType);
string serviceNamespace = serviceAttribute.Namespace;
bool serviceDefaultIsEncoded = SoapReflector.ServiceDefaultIsEncoded(serverType);
SoapReflectionImporter soapImporter = SoapReflector.CreateSoapImporter(serviceNamespace, serviceDefaultIsEncoded);
XmlReflectionImporter xmlImporter = SoapReflector.CreateXmlImporter(serviceNamespace, serviceDefaultIsEncoded);
//
// Add some types relating to the methodInfo into the two importers
//
SoapReflector.IncludeTypes(methodInfo, soapImporter);
WebMethodReflector.IncludeTypes(methodInfo, xmlImporter);
//
// Create a SoapReflectedMethod by reflecting on the
// LogicalMethodInfo passed to us.
//
SoapReflectedMethod soapMethod = SoapReflector.ReflectMethod(methodInfo, false, xmlImporter, soapImporter, serviceNamespace);
//
// Most of the fields in this class are ----ed in from the reflected information
//
ImportReflectedMethod(soapMethod);
ImportSerializers(soapMethod, GetServerTypeEvidence(serverType));
ImportHeaderSerializers(soapMethod);
}
示例3: SoapServerMethod
public SoapServerMethod (Type serverType, LogicalMethodInfo methodInfo)
{
TypeStubInfo type = TypeStubManager.GetTypeStub (serverType, "Soap");
info = type.GetMethod (methodInfo.Name) as SoapMethodStubInfo;
if (info == null)
throw new InvalidOperationException ("Argument methodInfo does not seem to be a member of the server type.");
}
示例4: GetInitializer
/// <summary>
/// When the SOAP extension is accessed for the first time, the XML Web
/// service method it is applied to is accessed to store the file
/// name passed in, using the corresponding SoapExtensionAttribute.
/// </summary>
/// <param name="methodInfo">The method being called.</param>
/// <param name="attribute">Decorating attribute for the method.</param>
/// <returns>An initializer object.</returns>
/// <exception cref="ArgumentNullException">Thrown if
/// <paramref name="methodInfo"/> is null.</exception>
public override object GetInitializer(LogicalMethodInfo methodInfo,
SoapExtensionAttribute attribute) {
if (methodInfo == null) {
throw new ArgumentNullException("methodInfo");
}
return methodInfo.DeclaringType;
}
示例5: GetSoapMethodBinding
internal static string GetSoapMethodBinding(LogicalMethodInfo method)
{
string binding;
object[] customAttributes = method.GetCustomAttributes(typeof(SoapDocumentMethodAttribute));
if (customAttributes.Length == 0)
{
customAttributes = method.GetCustomAttributes(typeof(SoapRpcMethodAttribute));
if (customAttributes.Length == 0)
{
binding = string.Empty;
}
else
{
binding = ((SoapRpcMethodAttribute) customAttributes[0]).Binding;
}
}
else
{
binding = ((SoapDocumentMethodAttribute) customAttributes[0]).Binding;
}
if (method.Binding == null)
{
return binding;
}
if ((binding.Length > 0) && (binding != method.Binding.Name))
{
throw new InvalidOperationException(System.Web.Services.Res.GetString("WebInvalidBindingName", new object[] { binding, method.Binding.Name }));
}
return method.Binding.Name;
}
示例6: GetInitializer
public override object GetInitializer (LogicalMethodInfo methodInfo)
{
LogicalTypeInfo sti = TypeStubManager.GetLogicalTypeInfo (methodInfo.DeclaringType);
object[] ats = methodInfo.ReturnTypeCustomAttributeProvider.GetCustomAttributes (typeof(XmlRootAttribute), true);
XmlRootAttribute root = ats.Length > 0 ? ats[0] as XmlRootAttribute : null;
return new XmlSerializer (methodInfo.ReturnType, null, null, root, sti.GetWebServiceLiteralNamespace (sti.WebServiceNamespace));
}
示例7: GetAttribute
internal static WebServiceBindingAttribute GetAttribute(LogicalMethodInfo methodInfo, string binding)
{
if (methodInfo.Binding != null)
{
if ((binding.Length > 0) && (methodInfo.Binding.Name != binding))
{
throw new InvalidOperationException(Res.GetString("WebInvalidBindingName", new object[] { binding, methodInfo.Binding.Name }));
}
return methodInfo.Binding;
}
Type declaringType = methodInfo.DeclaringType;
object[] customAttributes = declaringType.GetCustomAttributes(typeof(WebServiceBindingAttribute), false);
WebServiceBindingAttribute attribute = null;
foreach (WebServiceBindingAttribute attribute2 in customAttributes)
{
if (attribute2.Name == binding)
{
if (attribute != null)
{
throw new ArgumentException(Res.GetString("MultipleBindingsWithSameName2", new object[] { declaringType.FullName, binding, "methodInfo" }));
}
attribute = attribute2;
}
}
if (((attribute == null) && (binding != null)) && (binding.Length > 0))
{
throw new ArgumentException(Res.GetString("TypeIsMissingWebServiceBindingAttributeThat2", new object[] { declaringType.FullName, binding }), "methodInfo");
}
return attribute;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:30,代码来源:WebServiceBindingReflector.cs
示例8: GetInitializer
public override object GetInitializer(LogicalMethodInfo methodInfo)
{
if (!ValueCollectionParameterReader.IsSupported(methodInfo))
{
return null;
}
return methodInfo.InParameters;
}
示例9: GetInitializers
public virtual object[] GetInitializers (LogicalMethodInfo[] methodInfos)
{
object[] initializers = new object [methodInfos.Length];
for (int n=0; n<methodInfos.Length; n++)
initializers [n] = GetInitializer (methodInfos[n]);
return initializers;
}
示例10: GetAttribute
internal static WebServiceAttribute GetAttribute(LogicalMethodInfo[] methodInfos)
{
if (methodInfos.Length == 0)
{
return new WebServiceAttribute();
}
return GetAttribute(GetMostDerivedType(methodInfos));
}
示例11: GetInitializer
public override object GetInitializer(LogicalMethodInfo methodInfo)
{
if (!IsSupported(methodInfo))
{
return null;
}
return methodInfo.InParameters;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:ValueCollectionParameterReader.cs
示例12: GetInitializer
public override object GetInitializer(LogicalMethodInfo methodInfo)
{
if (methodInfo.IsVoid)
{
return null;
}
return this;
}
示例13: GetInitializers
internal static object[] GetInitializers(LogicalMethodInfo methodInfo, SoapReflectedExtension[] extensions)
{
object[] objArray = new object[extensions.Length];
for (int i = 0; i < objArray.Length; i++)
{
objArray[i] = extensions[i].GetInitializer(methodInfo);
}
return objArray;
}
示例14: GetInitializers
public virtual object[] GetInitializers(LogicalMethodInfo[] methodInfos)
{
object[] objArray = new object[methodInfos.Length];
for (int i = 0; i < objArray.Length; i++)
{
objArray[i] = this.GetInitializer(methodInfos[i]);
}
return objArray;
}
示例15: IsSupported
/// <include file='doc\ValueCollectionParameterReader.uex' path='docs/doc[@for="ValueCollectionParameterReader.IsSupported"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
static public bool IsSupported(LogicalMethodInfo methodInfo) {
if (methodInfo.OutParameters.Length > 0)
return false;
ParameterInfo[] paramInfos = methodInfo.InParameters;
for (int i = 0; i < paramInfos.Length; i++)
if (!IsSupported(paramInfos[i]))
return false;
return true;
}