本文整理汇总了C#中System.Runtime.Remoting.Messaging.Header类的典型用法代码示例。如果您正苦于以下问题:C# Header类的具体用法?C# Header怎么用?C# Header使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Header类属于System.Runtime.Remoting.Messaging命名空间,在下文中一共展示了Header类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: MethodCall
public MethodCall(Header[] h1)
{
this.Init();
this.fSoap = true;
this.FillHeaders(h1);
this.ResolveMethod();
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:MethodCall.cs
示例2: GetChannelHeaders
private Header[] GetChannelHeaders(ITransportHeaders requestHeaders, out string soapActionToVerify)
{
string str3;
string str4;
soapActionToVerify = null;
string uRI = (string) requestHeaders["__RequestUri"];
string uri = (string) requestHeaders["SOAPAction"];
if (uri == null)
{
throw new RemotingException(CoreChannel.GetResourceString("Remoting_SoapActionMissing"));
}
uri = HttpEncodingHelper.DecodeUri(uri);
soapActionToVerify = uri;
if (!SoapServices.GetTypeAndMethodNameFromSoapAction(uri, out str3, out str4))
{
Type serverTypeForUri = RemotingServices.GetServerTypeForUri(uRI);
if (serverTypeForUri == null)
{
throw new RemotingException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_TypeNotFoundFromUri"), new object[] { uRI }));
}
str3 = "clr:" + serverTypeForUri.FullName + ", " + serverTypeForUri.Assembly.GetName().Name;
}
else
{
str3 = "clr:" + str3;
}
int num = 2;
Header[] headerArray = new Header[num];
headerArray[0] = new Header("__Uri", uRI);
headerArray[1] = new Header("__TypeName", str3);
return headerArray;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:32,代码来源:SoapServerFormatterSink.cs
示例3: DeserializeMessage
private IMessage DeserializeMessage(IMethodCallMessage mcm, ITransportHeaders headers, Stream stream)
{
IMessage message;
string str2;
string str3;
Header[] h = new Header[] { new Header("__TypeName", mcm.TypeName), new Header("__MethodName", mcm.MethodName), new Header("__MethodSignature", mcm.MethodSignature) };
string contentType = headers["Content-Type"] as string;
HttpChannelHelper.ParseContentType(contentType, out str2, out str3);
if (string.Compare(str2, "text/xml", StringComparison.Ordinal) == 0)
{
message = CoreChannel.DeserializeSoapResponseMessage(stream, mcm, h, this._strictBinding);
}
else
{
int count = 0x400;
byte[] buffer = new byte[count];
StringBuilder builder = new StringBuilder();
for (int i = stream.Read(buffer, 0, count); i > 0; i = stream.Read(buffer, 0, count))
{
builder.Append(Encoding.ASCII.GetString(buffer, 0, i));
}
message = new ReturnMessage(new RemotingException(builder.ToString()), mcm);
}
stream.Close();
return message;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:26,代码来源:SoapClientFormatterSink.cs
示例4: Serialize
public void Serialize(Stream serializationStream, object graph, Header[] headers) {
if(serializationStream == null)
throw new ArgumentNullException("serializationStream");
if(!serializationStream.CanWrite)
throw new SerializationException("Can't write in the serialization stream");
if(graph == null)
throw new ArgumentNullException("graph");
SoapWriter soapWriter = new SoapWriter(serializationStream, _selector, _context, _topObject);
soapWriter.Serialize (graph, headers, _typeFormat, _assemblyFormat);
}
开发者ID:nlhepler,项目名称:mono,代码行数:10,代码来源:SoapFormatter.cs
示例5: StaticConsumeContext
ConsumeContext IMessageDeserializer.Deserialize(ReceiveContext receiveContext)
{
object obj;
var headers = new Header[0];
using (Stream body = receiveContext.GetBody())
{
obj = _formatter.Deserialize(body, x => headers = x);
}
return new StaticConsumeContext(_sendEndpointProvider, _publishEndpoint, receiveContext, obj, headers);
}
开发者ID:kotvisbj,项目名称:MassTransit,代码行数:11,代码来源:BinaryMessageDeserializer.cs
示例6: MethodCall
public MethodCall (Header [] h1)
{
Init();
if (h1 == null || h1.Length == 0) return;
foreach (Header header in h1)
InitMethodProperty (header.Name, header.Value);
ResolveMethod ();
}
开发者ID:runefs,项目名称:Marvin,代码行数:11,代码来源:MethodCall.cs
示例7: Serialize
public void Serialize(Stream serializationStream, object graph, Header[] headers)
{
if (serializationStream == null)
{
throw new ArgumentNullException("serializationStream");
}
InternalFE formatterEnums = new InternalFE {
FEtypeFormat = this.m_typeFormat,
FEtopObject = this.m_topObject,
FEserializerTypeEnum = InternalSerializerTypeE.Soap,
FEassemblyFormat = this.m_assemblyFormat
};
new ObjectWriter(serializationStream, this.m_surrogates, this.m_context, formatterEnums).Serialize(graph, headers, new SoapWriter(serializationStream));
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:SoapFormatter.cs
示例8: MethodCall
// Constructors.
public MethodCall(Header[] h1)
{
isSoap = true; // This form is used for SOAP requests.
Init();
if(h1 != null)
{
foreach(Header h in h1)
{
ProcessHeader(h.Name, h.Value);
}
}
ResolveMethod();
AccessCheck();
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:15,代码来源:MethodCall.cs
示例9: MethodResponse
public MethodResponse (Header[] h1, IMethodCallMessage mcm)
{
if (mcm != null)
{
_methodName = mcm.MethodName;
_uri = mcm.Uri;
_typeName = mcm.TypeName;
_methodBase = mcm.MethodBase;
_methodSignature = (Type[]) mcm.MethodSignature;
_args = mcm.Args;
}
if (h1 != null)
{
foreach (Header header in h1)
InitMethodProperty (header.Name, header.Value);
}
}
开发者ID:jack-pappas,项目名称:mono,代码行数:18,代码来源:MethodResponse.cs
示例10: Serialize
internal void Serialize(Stream serializationStream, object graph, Header[] headers, bool check)
{
if (serializationStream == null)
{
throw new ArgumentNullException(nameof(serializationStream));
}
var formatterEnums = new InternalFE()
{
_typeFormat = _typeFormat,
_serializerTypeEnum = InternalSerializerTypeE.Binary,
_assemblyFormat = _assemblyFormat,
};
var sow = new ObjectWriter(_surrogates, _context, formatterEnums, _binder);
BinaryFormatterWriter binaryWriter = new BinaryFormatterWriter(serializationStream, sow, _typeFormat);
sow.Serialize(graph, headers, binaryWriter, check);
_crossAppDomainArray = sow._crossAppDomainArray;
}
开发者ID:Corillian,项目名称:corefx,代码行数:19,代码来源:BinaryFormatter.cs
示例11: MethodResponse
// Constructors.
public MethodResponse(Header[] h1, IMethodCallMessage mcm)
{
isSoap = true; // This form is used for SOAP requests.
if(mcm == null)
{
throw new ArgumentNullException("mcm");
}
methodName = mcm.MethodName;
typeName = mcm.TypeName;
method = mcm.MethodBase;
hasVarArgs = mcm.HasVarArgs;
if(h1 != null)
{
foreach(Header header in h1)
{
ProcessHeader(header.Name, header.Value);
}
}
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:20,代码来源:MethodResponse.cs
示例12: MethodResponse
public MethodResponse(Header[] h1, IMethodCallMessage mcm)
{
if (mcm == null)
{
throw new ArgumentNullException("mcm");
}
Message message = mcm as Message;
if (message != null)
{
this.MI = message.GetMethodBase();
}
else
{
this.MI = mcm.MethodBase;
}
if (this.MI == null)
{
throw new RemotingException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_Message_MethodMissing"), new object[] { mcm.MethodName, mcm.TypeName }));
}
this._methodCache = InternalRemotingServices.GetReflectionCachedData(this.MI);
this.argCount = this._methodCache.Parameters.Length;
this.fSoap = true;
this.FillHeaders(h1);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:24,代码来源:MethodResponse.cs
示例13: InternalSetHeaders
internal void InternalSetHeaders(Header[] headers)
{
this._sendHeaders = headers;
this._recvHeaders = null;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:5,代码来源:LogicalCallContext.cs
示例14: GetPropertyKeyForHeader
internal static string GetPropertyKeyForHeader(Header header)
{
if (header == null)
{
return null;
}
if (header.HeaderNamespace != null)
{
return (header.Name + ", " + header.HeaderNamespace);
}
return header.Name;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:LogicalCallContext.cs
示例15: ReadObjectGraph
public void ReadObjectGraph (BinaryElement elem, BinaryReader reader, bool readHeaders, out object result, out Header[] headers)
{
headers = null;
// Reads the objects. The first object in the stream is the
// root object.
bool next = ReadNextObject (elem, reader);
if (next) {
do {
if (readHeaders && (headers == null))
headers = (Header[])CurrentObject;
else
if (_rootObjectID == 0) _rootObjectID = _lastObjectID;
} while (ReadNextObject (reader));
}
result = _manager.GetObject (_rootObjectID);
}
开发者ID:runefs,项目名称:Marvin,代码行数:18,代码来源:ObjectReader.cs
示例16: WriteObjectGraph
public void WriteObjectGraph (BinaryWriter writer, object obj, Header[] headers)
{
_pendingObjects.Clear();
if (headers != null) QueueObject (headers);
QueueObject (obj);
WriteQueuedObjects (writer);
WriteSerializationEnd (writer);
_manager.RaiseOnSerializedEvent ();
}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:9,代码来源:ObjectWriter.cs
示例17: Serialize
// Commences the process of serializing the entire graph. All of the data (in the appropriate format
// is emitted onto the stream).
internal void Serialize(Stream serializationStream, Object graph, Header[] headers, bool fCheck)
{
if (serializationStream==null)
{
throw new ArgumentNullException("serializationStream", String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentNull_WithParamName"),serializationStream));
}
SerTrace.Log(this, "Serialize Entry");
InternalFE formatterEnums = new InternalFE();
formatterEnums.FEtypeFormat = m_typeFormat;
formatterEnums.FEserializerTypeEnum = InternalSerializerTypeE.Binary;
formatterEnums.FEassemblyFormat = m_assemblyFormat;
ObjectWriter sow = new ObjectWriter(m_surrogates, m_context, formatterEnums);
__BinaryWriter binaryWriter = new __BinaryWriter(serializationStream, sow, m_typeFormat);
sow.Serialize(graph, headers, binaryWriter, fCheck);
m_crossAppDomainArray = sow.crossAppDomainArray;
}
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:20,代码来源:binaryformatter.cs
示例18: PropagateIncomingHeadersToCallContext
[System.Security.SecurityCritical] // auto-generated
internal void PropagateIncomingHeadersToCallContext(IMessage msg)
{
BCLDebug.Assert(msg != null, "Why is the message null?");
// If it's an internal message, we can quickly tell if there are any
// headers.
IInternalMessage iim = msg as IInternalMessage;
if (iim != null)
{
if (!iim.HasProperties())
{
// If there are no properties just return immediately.
return;
}
}
IDictionary properties = msg.Properties;
BCLDebug.Assert(properties != null, "Why are the properties null?");
IDictionaryEnumerator e = (IDictionaryEnumerator) properties.GetEnumerator();
// cycle through the properties to get a count of the headers
int count = 0;
while (e.MoveNext())
{
String key = (String)e.Key;
if (!key.StartsWith("__", StringComparison.Ordinal))
{
// We don't want to have to check for special values, so we
// blanketly state that header names can't start with
// double underscore.
if (e.Value is Header)
count++;
}
}
// If there are headers, create array and set it to the received header property
Header[] headers = null;
if (count > 0)
{
headers = new Header[count];
count = 0;
e.Reset();
while (e.MoveNext())
{
String key = (String)e.Key;
if (!key.StartsWith("__", StringComparison.Ordinal))
{
Header header = e.Value as Header;
if (header != null)
headers[count++] = header;
}
}
}
_recvHeaders = headers;
_sendHeaders = null;
} // PropagateIncomingHeadersToCallContext
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:60,代码来源:CallContext.cs
示例19: InternalSetHeaders
} // InternalGetOutgoingHeaders
internal void InternalSetHeaders(Header[] headers)
{
_sendHeaders = headers;
_recvHeaders = null;
} // InternalSetHeaders
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:8,代码来源:CallContext.cs
示例20: PropagateIncomingHeadersToCallContext
internal void PropagateIncomingHeadersToCallContext(IMessage msg)
{
IInternalMessage message = msg as IInternalMessage;
if ((message == null) || message.HasProperties())
{
IDictionaryEnumerator enumerator = msg.Properties.GetEnumerator();
int num = 0;
while (enumerator.MoveNext())
{
string key = (string) enumerator.Key;
if (!key.StartsWith("__", StringComparison.Ordinal) && (enumerator.Value is Header))
{
num++;
}
}
Header[] headerArray = null;
if (num > 0)
{
headerArray = new Header[num];
num = 0;
enumerator.Reset();
while (enumerator.MoveNext())
{
string str2 = (string) enumerator.Key;
if (!str2.StartsWith("__", StringComparison.Ordinal))
{
Header header = enumerator.Value as Header;
if (header != null)
{
headerArray[num++] = header;
}
}
}
}
this._recvHeaders = headerArray;
this._sendHeaders = null;
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:38,代码来源:LogicalCallContext.cs
注:本文中的System.Runtime.Remoting.Messaging.Header类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论