小编pat*_*chi的帖子

通过ProxyServer发送WCF请求

这是我的客户端WCF配置文件:

<configuration>

  <system.net>
    <defaultProxy 
      enabled="true" 
      useDefaultCredentials="true">

      <proxy 
        usesystemdefault="False" 
        bypassonlocal="False" 
        proxyaddress="http://172.20.20.254:8088/"
      />

    </defaultProxy>
  </system.net>

<system.serviceModel>
  <client>
    <endpoint
      address="http://172.20.20.100:8080/Demo/text"
      binding="customBinding"
      bindingConfiguration="text"
      contract="DemoService.IDemoService"
      behaviorConfiguration="largeObjectGraph_behaviorConfig"
      name="text" />
  </client>

  <!-- Allow To Desrialize Larg Data -->
  <behaviors>
    <endpointBehaviors>
      <behavior name="largeObjectGraph_behaviorConfig">
        <dataContractSerializer maxItemsInObjectGraph="2147483646"/>
      </behavior>
    </endpointBehaviors>
  </behaviors>

  <bindings>
    <customBinding>

      <binding name="text" 
               closeTimeout="10675199.02:48:05.4775807" 
               openTimeout="10675199.02:48:05.4775807"
               receiveTimeout="10675199.02:48:05.4775807" 
               sendTimeout="10675199.02:48:05.4775807">

        <CustomMessageEncoder 
              MaxArrayLength="1073741824" 
              MaxBytesPerRead="1073741824"
              MaxDepth="1073741824" 
              MaxNameTableCharCount="1073741824" 
              MaxStringContentLength="1073741824" />

        <httpTransport 
          maxBufferPoolSize="1073741824" 
          maxReceivedMessageSize="1073741824"
          maxBufferSize="1073741824" />

      </binding>
    </customBinding>
  </bindings>

  <extensions>
    <bindingElementExtensions>
      <add name="CustomMessageEncoder" type="CustomMessageEncoder.CustomMessageEncodingElement, CustomMessageEncoder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
    </bindingElementExtensions>
  </extensions>

    </system.serviceModel>
</configuration>
Run Code Online (Sandbox Code Playgroud)

使用CustomMessageEncoder绑定以压缩和加密消息.

这是问题:我们的局域网中有Proxy-Server [172.20.20.254:8088]. …

c# wcf wcf-binding wcf-extensions

4
推荐指数
1
解决办法
2万
查看次数

在C#中获取方法的名称

有没有办法得到目前我们在其中的方法的名称?

private void myMethod()
{
    string methodName = __CurrentMethodName__;
    MessageBox(methodName);
}
Run Code Online (Sandbox Code Playgroud)

像this.ToString()返回类名是否有任何可能的方法来通过监视或跟踪应用程序来获取方法的名称?

.net c# monitoring trace

4
推荐指数
2
解决办法
365
查看次数

如何读取一个对象变量的字节(现在它在RAM中)并通过它在C#中重新创建字节?

我想访问C#okey中对象的字节,例如:

在WCF中序列化一个类,序列化器读取类对象的所有字节和最后的SOAP消息!

有些事你知道一种方法来读取对象字节并通过字节重新创建对象

//x_obj created and we allocate an address & size of RAM (memory) to it Now its byts structure is in the RAM

X_calss x_obj = new X_class(); 

//and now we want to read the x_obj bytes in RAM
unsafe byte[] READ(X_class x_obj){
 xobj_pointer = &x_obj;//pointer to address of obj in RAM
 byte[] xobj_bytes = read_from(xobj_pointer,sizeof(x_obj));//Some Way To Read Byte of x_obj
 return xobj_bytes;
}
// and now we want to recreate class by it bytes stream
unsafe …
Run Code Online (Sandbox Code Playgroud)

c# memory-access

0
推荐指数
1
解决办法
888
查看次数

标签 统计

c# ×3

.net ×1

memory-access ×1

monitoring ×1

trace ×1

wcf ×1

wcf-binding ×1

wcf-extensions ×1