Websync not working

485 Views Asked by At

websync in my service was working properly, but after some changes it stop working, its not giving me any error message and all seems fine to me. but there must be some issue. i created the test page on my website but not working in that too. i am posting here that code please look and suggest.

public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Publisher publisher = new Publisher(new PublisherArgs() { RequestUrl = "http://www.ffrsdevserver.com/request.ashx" });          
            Data entity = new Data();
            entity.DeptID = 1.ToString();
            entity.StationId = "108";
            entity.Text = "UpdateAll";
            publisher.Publish(new Publication()
            {
                Channel = "/3db165bf2f25",
                DataJson = JSON.Serialize(entity)
            });
        }
    }

    [DataContract]
    public class Data
    {
        private string text = string.Empty;
        private string deptId = string.Empty;
        private string dataType = string.Empty;
        private string stationId = string.Empty;

        [DataMember(Name = "text")]
        public string Text
        {
            get { return text; }
            set { text = value; }
        }

        [DataMember(Name = "deptId")]
        public string DeptID
        {
            get { return deptId; }
            set { deptId = value; }
        }


        [DataMember(Name = "stationId")]
        public string StationId
        {
            get { return stationId; }
            set { stationId = value; }
        }
    }
1

There are 1 best solutions below

1
On

I solve the issue. actually websync does not allow publishing from outside the application, so when i call publish method from the window service it does not work, so we need to add this tag in the web config file

<configuration>
  <WebSync>
    <server httpDirectPublish="true" timeout="25000" reconnectInterval="250" distributeInterval="100" latencyBuffer="7000" heartbeatInterval="30000" />
  </WebSync>
</configuration>

this will give permission to website to be published from outside