function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kviswanadhakviswanadha 

is there a Bayeux implementation for .NET Clients.

Hi,

I am trying to build an app on .NET that uses the Streaming API and sends the notifications down to .NET Client. I am not sure i there is a Bayeux services references that can be used in .NET for this work.

 

Can anyone post any thoughts?

KevinG514KevinG514

I ran into the same problem

 

http://boards.developerforce.com/t5/Streaming-API-Developer-Preview/streaming-with-net-app/td-p/320127

 

For my prototype, I ended up writing a console app in java and started it from my c# code and just listened to the console output for the data that came in.  

KevinG514KevinG514

I tried that implementation, i didn't have any luck with it.  It should just be a port from java, but i couldn't get it to work.  Now last time i tried was mid summer '11, so things could have changed since then. 

gwestrgwestr

I wrote my own cometd client in Java so that I could learn the Bayeux Specification and make sure that our server implementation was compliant.  It shouldn't be that hard to do in .NET, so long as you have access to a good JSON parser and an HTTP client.

 

Are people looking to use C# or VB?

 

Remember that if you are in a browser you can use the Javascript client with any server side framework.  This discussion should only apply to thick desktop clients.

gwestrgwestr

I threw it up on github if anyone wants to reference it.  Basically it's an implementation of a cometd client in StatelessStreamingClient, and a nice utility class on top of that in StreamingClientImpl.  Thre rest is a bunch of Json2Java POJO classes that I use to bind responses to, or serialize requests from.

 

https://github.com/gwestersfdc/CometClient

 

sammydsammyd

well, I got the code from git, but. org.apache.commons.httpclient seems elusive.

 

The Commons HttpClient project is now end of life, and is no longer being developed. It has been replaced by the Apache HttpComponents

you cannot download the legacy code, takes you to the new stuff

 

but the classes have changed as well.  so your code no longer compiles without change

 

and org.json.* takes me around the block too.. I can get source, but no runtime jar..  lookup on the web says use one of the other more modern classes

(json.simple, json.stringtree)..

gwestrgwestr

The project requires Maven 2.  If you are using eclipse, install the m2eclipse plugin and it will build automatically.

 

From the command line you can type "mvn install" in the project root and it will build successfully.

 

Remember that is code is simply an interface to the streaming API.  You would include this as a jar or as source in a larger project that gets a session ID from Salesforce with WSC or from OAuth2.  And then you'd display the results somewhere.  You would probably only use this particular project if you had a Java GUI app, swing app, or the new Nimbus UI framework in Java 7.

gwestrgwestr

Here's some code for learning how to get a session ID from OAuth:

 

https://github.com/gwestersfdc/CRM-OAuth-Provider

 

john cook 22john cook 22
Don’t ever give up on your blogs as they are a source of happiness for the people. Keep sharing. Thank you.  accedilogin (http://accedilogin.info/)
googer markgooger mark
 Kroger is recognized as the biggest and leading supermarket chain in the United States of America. This company was found in 1883 by Bernard Kroger. kroger feedback survey (http://konlinesurvey.com/kroger-customer-feedback-survey/)