How to test connectivity to couchbase server using .NET sdk? - nosql

I'm trying to test connectivity to couchbase server using the .NET sdk.
I've tried to get a test key in order to do it, but I'm getting "null" (instead of getting an exception mention that couchbase server is done).
I've also read this:
http://www.couchbase.com/docs//couchbase-manual-2.0/couchbase-getting-st...
But it doesn't say anything about testing connectivity from an application code.
Is there any way of testing connection to couchbase server via code ?

The couchbase client sdk manages the connections for you, whatever node urls you pass to it during construction it attempts to authenticate to, if the client can't authenticate to one of the nodes then it throws ConnectException (I'm using the JAVA sdk but I imagine .NET is very similar).
So really you don't have to test the connectivity, the smart client handles that. After construction you can ask the client to list all the available servers
client.getAvailableServers();
Or for a more detailed status of your nodes and statistics do:
client.getStats();

Related

Suggestion or help needed for implementing stateless ejabberd architecture

I want to implement a real-time chat application. Technologies, database and OS used for this purpose:
Node.JS
Ejabberd as XMPP server
MySQL Database
React-Native (Front-End)
OS - Ubuntu 18.04
By far, I have achieved setting up ejabberd and registering the user and getting status from both the API and command line. For example, I can register a user from any other device/system and from the command line too. But the problem with this is that all the data gets stored in ejabberd database on the Ubuntu server due to which there are data duplication chances also I already have a database structured and defined and already have data in that.
In ejabberd tutorials, there is a part where they have mentioned stateless architecture where the ejabberd server manages XMPP part with our database (I didn't understand a lot about this stateless thing). So I need some help, example or tutorials where there is more understanding about the stateless architecture.
Already gone through below mentioned links -
https://blog.process-one.net/wp-content/uploads/2016/09/designing-a-modern-XMPP-service-with-ejabberd.pdf
https://www.youtube.com/watch?v=-dqQfCpw98E&feature=youtu.be&t=1m33s (Tutorial where Stateless is mentioned)
https://www.slideshare.net/mremond/xmpp-academy-2
https://docs.ejabberd.im/tutorials/ (Official tutorials about ejabberd)
Not-helpful links -
ejabberd stateless configuration
To configure stateless ejabberd, you need to configure your storage module to store the data using ReST API. Stateless ejabberd was designed for fluux.io service, but you can also implement it yourself using contributions or ejabberd API.
For example, for user based, you can rely on ejabberd_auth_http: https://github.com/processone/ejabberd-contrib/tree/master/ejabberd_auth_http

How should I build a server for mobile-apps

I'm planning to build an application that will include users registration and so on.. I want to build a kind of social network application and i wonder how should I build my server and what is the right way to connect between the application and the server?
I know to build clients and servers in python and connect between them with sockets, but I realise that this is not the right way to do it in mobile applications..
someone told me I should learn something called SOA or web application server , I did not understand him so well,
I hope that you understand what I search for, thanks!
A good start is to create a REST-based backend service that exposes methods/operations via HTTP. Host the service on your server, and allow the app to communicate with the service. This service can send and receive data, typically in the JSON format, between the service and your app(s). Try looking here for some examples:
Python: https://www.sitepoint.com/building-simple-rest-api-mobile-applications/
.NET: https://learn.microsoft.com/en-us/aspnet/web-api/overview/older-versions/build-restful-apis-with-aspnet-web-api

GridGain REST client to

I've dug around and found the following but where not particularly useful (and why)
- Does GridGain support SSL connection between each cluster member? was
this wasn't so much useful as it didn't give much information on actually running and using the client
- http://atlassian.gridgain.com/wiki/display/GG60/HTTP+Client
unlike other parts of the documentation which comes with examples, the GridGain docs for HTTP REST client just shows you the fields and its properties
What I am trying to do:
I have a cluster over a virtual network running on separate virtual machines. I wish to set up a REST service so that I can hit an endpoint to store data. ie. curl POST to localhost:8080/store/ with a parameters object (or some variation of this situation, so long as I can do it over HTTP) and have that data stored into the GridGain cache
GridGain REST protocol is MemCached compliant, so you can connect to GridGain using any MemCached compatible client.
GridGain downloadable distribution has PHP HTTP and MemCached examples in examples/rest folder.

How to Testing with proxy servers

I have some code in .NET V2.0 that is talking to an asmx service
As a related issue I also have some code in the same winforms app that is doig BITS uploads
We are a very small shop and quite frankly do not have any sort of proxy server setup
But of course our clients will
I want to test with a proxy server sitting between my home FIOS connection and the internets and I want to test when auth information is required against the proxy server
Clearly the number of configurations in the wild are way many but any suggestions welcome
1) Any public proxy servers where I can create credential based accounts and test?
2) any catch all .NET solution like asking for creds setting them somehow on BITS uploads and asmx services and then just assuming they work 90% of the time
Thanks
You could run a proxy server on your own computer, then 'connect to yourself' as the proxy.

Consuming a WCF Service with Monotouch via SSL (https) + basicHttpBinding

I'm currently writing a iphone app which will consume WCF services over a secure connection (SSL/https). I have managed to consume this service while testing locally via http.
Now we want to make sure the service is secure, so we've set up a UAT server with a properly signed certificate to run our tests.
We are using a custom binding, coupled with security mode TransportWithMessageCredentials which requires a username/password in the ClientCredentials property.
Generated the proxy using SISvcUtil.exe
When I try to call this secure service from the iPhone, I get a rather lovely generic error of:
Exception in async operation: System.Net.WebException: There was an error on processing web request: Status code 500(internal server error)
(Here is a pastebin of full exception ).
I've tried implicitly accepting the certificate using:
ServicePointManager.ServerCertificateValidationCallBack = (sender, cert, chain, ssl) => true;
but this just returns the same 500 error.
The same code works great on a windows machine but not on the iphone. Has anyone else come across this problem and/or know of a solution to it?
This could be a bug in monotouch, it may not have full implementation of generated proxy using SISvcUtil.exe, did you try generating a mac app and test it on mac?
Does monotouch have any documented example with support on WCF proxy? If they dont have then probably it may not work, monotouch does not provide a .NET runtime, instead it actually compiles everything to native ios binary. So if WCF proxy is not correctly transformed, it will not work.
So it would seem that at the time of writing, Monotouch doesn't support WCF very well (it currently has a barebones implementation).
Due to this, and the need for decent security around our webservice, we've decided to go down a different route; validating the user via username+password over a secure, encrypted SSL connection everytime the web service is called. We use Silverlight 3.0 SiSUtil.exe to generate the bindings for the webservice rather than include it as a web reference in the project.
Generally when getting Internal Server errors I've found the cause to be a problem with the HTTP headers being sent in the request. I don't really use WCF on MonoTouch so I'm not sure about the implementation.