WCF返回Image对象超时
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Multiple)]public class MessageService : IMessage
{
public Image GetImage()
{
return Image.FromFile("用户管理.png");
}
}
[ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(IMessageCallback))]
public interface IMessage
{
[OperationContract(IsOneWay = false, IsInitiating = true, IsTerminating = false)]
Image GetImage();
}
我定义了一个方法 返回一个图像 为什么客户端调用的时候总是超时?(把Image换成Stream就可以)