wcf-wcf byte [] / memorystream / base64字符串可以提高性能

时间:2011-03-31 08:54:07

标签: wcf

我写了另一个wcf服务(ServiceA)的wcf服务(serviceB)。

ServiceA和ServiceB都运行相同的计算机。我正在使用nettcpbinding。 (因为它是wcf-wcf通信的好选择,这两个服务也在同一台机器上的内联网上。)

ServiceB的Service Contract参数是frontimage,backimage。

传递frontimage和backimage以改善性能的最佳方法是什么?我正在使用byte [],

i..e,

这是Serviceb的操作ocntract

HashTable GetConvertedImage(byte [] frontImage,byte [] backImage);

我的问题是,如果我使用memorystream或base64string而不是使用byte [],它将改善性能。 GZipStream怎么样?

我可以在ServiceA中使用所需的参数。目标是提高绩效。

除了byte [] / memorystream / base64string之外,还有其他任何方法可以通过改进性能来处理大型图像。

请adivce

我也在使用nettcpbinding这种情况很好。

1 个答案:

答案 0 :(得分:0)

您可以修改服务以显示流而不是字节数组。然后,您可以将传输模式设置为Streaming。

更多细节on MSDN