Javascript publish not working

17 views
Skip to first unread message

James Fuhr

unread,
Mar 1, 2013, 11:22:19 AM3/1/13
to web...@googlegroups.com
I am using Websync Server 3 and trying to set up a publisher only event.

On the main page of the application, the user is connected and subscribed and also publishes.  This works great.

On another page, I want to just want to publish to a channel, not listen.   Here is the code I set up:

 
fm.websync.client.initialize({
            requestUrl
: "http://localhost:59081/Request.ashx"
       
});


        fm
.websync.client.publish({
            channel
: '/location1',
            data
: {
               
QueueID: 2
               
           
},
            onSuccess
: function (args) {
                alert
('yes');
           
},
            onFailure
: function (args) {
                alert
(args.error);
           
}


       
});

When page loads, publish does not fire.  I do not get an OnSuccess or OnFailure.

Is there something else that I am missing?

httpPublishDirect is also set to 'true' in web.config.


Jerod Venema

unread,
Mar 1, 2013, 11:28:06 AM3/1/13
to web...@googlegroups.com
Hey James!

The client has to be connected in order to publish. We have the "Publisher" class for backend publishing, but that doesn't work with JS - you have to connect/publish/disconnect if that's all you want to do. The alternative is to create an AJAX request to your own endpoint and do a direct Publisher call from there.

Best,



--
You received this message because you are subscribed to the Google Groups "WebSync" group.
To unsubscribe from this group and stop receiving emails from it, send an email to websync+u...@googlegroups.com.
To post to this group, send email to web...@googlegroups.com.
Visit this group at http://groups.google.com/group/websync?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/websync/-/S5O1My0uG_AJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Jerod Venema
Frozen Mountain Software
919-300-5141 (United States)
604-227-2453 (Canada)
888-379-6686 (Extension 101)

James Fuhr

unread,
Mar 1, 2013, 11:30:11 AM3/1/13
to web...@googlegroups.com
Ah okay.  Thanks!
Reply all
Reply to author
Forward
0 new messages