I am working on a REST API to communicate with one of the server which is communicating using oneM2M architecture. Does anybody have an idea how to decode its JSON format in dotnetcore?
If your program needs to communicate with a oneM2M CSE then you need to implement at least parts of the Service Layer Core Protocol. This is specified in oneM2M's TS-0004. You should also have a look at TS-0001, the Functional Architecture document, which beside of the general architecture, describes the individual resources, their structures and their relationships.
You can find these specifications here: http://www.onem2m.org/technical/published-documents.
If you are new to oneM2M then you definitely want to have a look at the "Getting Started" pages and the Application Developer Guide.
I have read the documentation of ElasticSearch and I am familiar with its endpoints and how to maintain Clusters,Nodes,Indices,etc.
Now I am planning to use it in an Asp.net web api and I am a little bit confused about what is the best way to implement it.
I found that ElasticSearch provides two options to work with .Net application:
1)Nest
2)ElasticSearch.net
So, my first question which way is preferred to integrate my web application with ElasticSearch so I can get advantage of the power of Elasticsearch in searching/analyzing/managing big amount of data and what are the advantages and disadvantages of each one ?
My second question I have read that Nest is a high level client and Elasticsearch.net is a low level one.What does that mean?
My third question do the above libraries expose all ElasticSearch endpoints or are there limitations?
My fourth question is there another way to integrate ElasticSearch in my web application other than the above two libraries?
I would appreciate any references,tutorials so I can get started with(because the documentation of ElasticSearch website is not clear).
Check out the documentation for the .NET clients as I think it answers all your questions.
Both NEST and Elasticsearch.Net expose all of the APIs within Elasticsearch, with the former mapping each request and response to a type so you don't need to do this yourself.
You can of course write your own implementation to interact with Elasticsearch over HTTP. Use whichever you're most comfortable with, but personally I'd recommend starting with NEST as it handles a lot of things for you such as mapping inference, connection behaviour with round-robin, etc. (disclaimer: I work on the Elasticsearch .NET clients).
For an example tutorial of integrating with a .NET (Nancy) web application, check out NuSearch.
I want to know the difference between multi-tenancy and single tenancy.
Is tomcat supporting mutli-tenancy .Can you explain both with an example.
I am asking this question in context to http-servers.
Definition
From Wiki definition
In a multitenancy environment, multiple customers share the same application, running on the same operating system, on the same hardware, with the same data-storage mechanism. The distinction between the customers is achieved during application design, thus customers do not share or see each other's data.
So you can imagine that single tenancy is the other way around.
Example
Let's take JIRA as an example,
If you use OnDemand JIRA Service, it is multi-tenant, cloud-based service.
If you download JIRA Standalone and install it for you organisation. It is single tenancy case.
Designing multi-tenancy software
Designing multi-tenancy software is nothing to do with the hosting technology. It's actually about the way you architect the software.
Tomcat in your case, is absolutely suitable for multi-tenancy software.
I'm selecting a framework for restful service. Restlet looks promising. However, I'd like to pick something that's mainstream enough that it won't go out of support/development too soon. I know restlet has been around for quite some years. However, I'd like to know if it's popular enough. My questions are,
Any big name companies using it?
Is the default http server good enough for production?
thanks
The Restlet Framework has been available since 2005 when it was the first RESTful web framework for Java. It has support for the JAX-RS API, but its own Restlet API is both client and server-side since day one, much more comprehensive and extensible. We are free to innovate based on our community feed-back, without having to go through lengthy JCP standardization processes.
Also, we just published the 'Restlet in Action' book last September along with its version 2.1. Our internal connector is fully asynchronous and based on NIO and we are constantly stabilizing it even though it isn't ready for heavy productions yet (use the Jetty connector or a Java EE container with no change to your Restlet application).
Its consistent support for Java SE/EE, OSGi, Android, GAE and GWT with dedicated editions is unique. A port to JS (Node.js + AJAX) is also under way. We have also started work on version 2.2 with the first milestone being released (with full Java 6 support, OAuth 2.0 extension based on the final spec, etc.).
In term of references, we have many large companies using it including LinkedIn (see their GLU open source project), IBM, NVidia, ForgeRock, NASA, Sonatype, Apache Camel, Mule ESB, etc. Google has been using it internally as well. See some quotes here:
http://restlet.com/discover/quotes
In January, we'll launch a new community web site as well as APISpark, an all-in-one platform to create, host, manage and use web APIs, directly based on Restlet Framework (PaaS), so the project is active and has an exciting future!
Best regards,
Jerome Louvel
PS: I'm the Restlet Framework creator and lead developer.
The most mainstream you can get is Jersey. It is the official implementation of rest in java. Restlet came out before Jersey. But then Jersey surpassed them (in my humble opinion). I have used both Jersey and Restlet on serious projects. They are both good. However, you will find more support, more books, and more examples on Jersey.
Is this about Java? In that case, JAX-RS is the awesome new API for doing this. The best book for this is Restful Java with JAX-RS. My favorite implementation of it is Jersey, but there are others with their own unique features. All JAX-RS implementations are compatible if you don't use their distinctive features (which are minor anyway). The book explains the core API, the REST philosophy, and also some of the features unique to the different implementations. It is an excellent book. I love the introduction, where the author relates how he was used to traditional remote procedure call (like SOAP, WCF, and ordinary OO semantics) but then saw the light of the REST principles as being simpler and more elegant.
I use Tomcat as the HTTP server (servlet container). It is lightweight and is what Amazon Beanstalk uses (you can just upload your application, the WAR file, to it and it just works). You can also use GlassFish which supports many more JavaEE features, or use Apache for static pages and other things, and forward the REST requests to Tomcat/GlassFish.
The annoying thing about JAX-RS is that it's so powerful and easy that you're tempted to write ideologically-sound REST services. Unfortunately, javascript can't use many of the REST features (setting Accept header, calling anything but GET/POST, etc.) But it's not a big deal.
Jersey also has a fantastic client-side Java API that mirrors JAX-RS and reuses the same annotated classes, if your clients will be Java.
From the article
The Servlet API was released in 1998 and its core design hasn't
significantly changed since that time. It is one of the most
successful Java EE APIs, but it suffers from several design flaws and
limitations. For example, the mapping between the URI patterns and the
handlers is limited and centralized in one configuration file. Also,
it gives control of the socket streams directly to the application
developer, preventing some IO optimizations by the Servlet containers
like the full usage of NIO features. Finally it does not support HTTP
features like caching, content negotiation and content compression
very well, causing too much pain to developers and preventing them to
focus on their application specific code.
Another major concern was the lack of a modern HTTP client API in the
Java EE stack. The JDK's HttpURLConnection class is hard to use and
leaves too much HTTP features unsupported like expressing client
preferences for content negotiation.
Frequently, people were relying on third-party HTTP client APIs to
workaround those limitations. Again, NIO can't be supported with
HttpURLConnection.
In 2005, I saw an opportunity to go beyond all those limitations, and
to design a fresh API in the light of the REST principles. For the
first time, we have an API that unifies client-side and server-side
Web applications, an API that fully supports NIO and an API that lets
the developer programmatically control its container, connectors and
deployed applications without having to constantly rely on XML
descriptors.
How can we consume any web services in Lotus Notes 6.5. I have seen reference to Soap Connect API. Is it the only way to do it..?
Any example will be a great help..
Thanks..
There is no out of the box solution for LotusScript and WS Consumers in R6. You would need to create your own system to shape the SOAP request, send it to the server and parse the SOAP response.
You are not going to get the benefits from using Web Services in this fashion. The whole point is that you should not have to do this.
If you use the Java route you can use Apache Axis libraries to add consuming functionality.
http://axis.apache.org/axis/
Here is a very old developerworks article on it:
http://www.ibm.com/developerworks/lotus/library/domino-webservices/
Ultimately though I'd recommend to upgrade to a later version that does support WS consumers in LotusScript. Although be aware that LS suffers in WS due to limitations of the programming language.
What I did in R6 is creating Web based agents using LotusScript which behaved like Web Services. It performed rather good for services that weren't called by too many users at the same time (as far as I remeber...)-
This presentation / sample might be helpful for you:
http://www.slideshare.net/billbuchan/jmp206-lotus-domino-web-services-jumpstart#btnNext
Full files from Bill's presentation including sample are available for download here:
http://www.hadsl.com/HADSL.nsf/Documents/Lotusphere+2008+-+JMP206+-+Web+Services+Bootcamp!OpenDocument
Another helpful link (if you want to use SOAP/Java):
http://www.ibm.com/developerworks/lotus/tutorials/lswsdom65/lswsdom65-pdf.pdf
If you are on Windows, you can use a COM object in LotusScript to call the webservice.
A good one that I used myself is PocketSOAP: http://www.pocketsoap.com/ . It has a lot of features, like support for https, using SOAP headers and sending attachments.
Many of PocketSOAPs features are unavailable or difficult to achieve even in a native R8 web service consumer, so this is an option for higher versions than Lotus Notes 6.5, too.