开发者

WCF web service stops responding after several repeated calls

开发者 https://www.devze.com 2023-03-16 15:30 出处:网络
I have Windows applications that communicate to the logic layer and data layer with a WCF web service.

I have Windows applications that communicate to the logic layer and data layer with a WCF web service. When the form is opened the connection to the web service is established and the connection is kept alive as long as the form is opened. On closing the from, the connection is closed using Finalize and Dispose on the web service. After several times opening and closing forms, the service stops responding and I need to reset service which hosted in the IIS to get it working again. Any hints on how to proceed with this issue?

this is my service contract:

[ServiceContract]
public interface ICommandInvoker : IDisposable
{
    [OperationContract(IsOneWay = false)]
    void Initialize(TypeInfo managerType, UserInfo userInfo, Dictionary<string,string> settingDic);

    [OperationContract(IsOneWay = true)]
    void Finalize();

    [OperationContract(IsOneWay = false, Action="*")]
    //[CustomOperationBehavior]
    ServerResult Execute(ServerCommand command);

    [OperationContract(IsOneWay = false, Name=开发者_StackOverflow社区"Execute Serialized")]
    string Execute(string command, TypeInfo typeInfo);

    [OperationContract(IsOneWay = false, Name = "Execute 2 Non Serialized")]
    ServerResult Execute(TypeInfo mangerType, UserInfo userInfo, ServerCommand command);

    [OperationContract(IsOneWay = false, Name = "Execute 2 Serialized")]
    string Execute(TypeInfo mangerType, UserInfo userInfo, string command, TypeInfo typeInfo);

    [OperationContract(IsOneWay = true)]
    void BeginExecute(ServerCommand command);

and this is my Service

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
public class BudgetService : BaseCommandInvoker<BudgetDataContext>, IBudgetService
{
    public BudgetService()
    {
    }
}

[ServiceContract(SessionMode = SessionMode.Required)]
public interface IBudgetService : ICommandInvoker
{
}

Do you have any sample program for this method of use Wcf?

thank you


Could be lots of things!

Is the server returning a timeout? How are you managing your try catch blocks? Are any errors being thrown. I would check if the channel has faulted because an Exception will fault the channel. Your service should be throwing FaultExceptions if something goes wrong.

Impossible to really help ant more without more information.

0

精彩评论

暂无评论...
验证码 换一张
取 消