Is there are any framework for ballerina - wso2

I read the documents of Ballerina https://ballerina.io/. I am interesting about Ballerina. Is there are any framework to build the web app using Ballerina?

At the moment there is no Web frameworks similar to ASP.NET MVC or Spring for Ballerina. However you can easily create single page web applications using Ballerina RESTful services. This is similar to ASP.net WebAPI or python with flask.
There you separate the Web pages which are written in HTML/JS.. from the backend APIs which you can write in Ballerina.
Please take a look at this https://ballerina.io/learn/by-guide/restful-service/

Related

cordova: How to develop web services for cordova mobile application

i am developing mobile application for one of my web app. After long search on google i found cordova to be the best for cross platform mobile app development. I am developing cordova based front end with ionic framework. I want to know which web service is the best one to communicate between mobile app & server. I am familier with REST for webapp but have no idea for mobile.
Note: My database is on server & i am communicating through web services only so no local database resides on mobile.
Thanks in advance for quick response.
Well angularJS with PHP & JSON object combination would be the best combination for the web services to develop for cordova application. Angular js used for cordova is the best to put at web service level too with PHP.
I found my answer after long search....:-)

Hibernate RESTful webservices in NetBeans

Is it possible to create RESTful Web Service using Hibernate in Netbeans 7.4?
I could see wizard to create RESTful Web Service using Persistence, but would like to know how it can be integrated with Hibernate?
Appreciate any help or insight.
Edit 1
I would like to know what I did is the correct method of generating RESTful web services using Hibernate.
First I generated Hibernate Entity classes using NetBeans and then I created RESTful services from Entity classes. So does this creates RESTful Web Services with Hibernate? I could see AbstractFacade classes that is almost like DAO classes
Edit 2
Screen shot for selecting RESTful Web Service from Entity classes
If you want to build a truly RESTful service, you need to build up a link relation architecture. You're going to need more than Hibernate or Netbeans to do that.
I recommend using the milestone Spring Data REST in conjunction with Hibernate's JPA implementation and Spring HATEOAS. See Spring Restbucks as an example which brings all these technologies together.

spring web controller use as web service

Currently I use Spring mvc to develop my we application. In future there will be a requirement to develop mobile app for this application.
In asp.net c# MVC have ability to use there web controller class as the web service. Then mobile app can use that controller class as web service.
I want to know is there an ability to use Spring MVC controllers as a we service. If yes, then how. Please explain.
You can easily write a Restful webservice using Spring MVC. The controller classes can return XML/JSON as required. It is simply a case of configuring an appropriate ViewResolver in this case a ContentNegotiationViewResolver.
This is an excellent guide which will walk you through the basics of Spring MVC as a webservice.

Approaches for creating REST Web services?

i am new to REST Service development. I compared the development mechanism for both REST and WS web services and i found that you can create a WS web service using WSDL file that is the top down appraoch (Correct me if i am wrong) and using bottom up approach also, that is generating the classes manually.
But when it comes to REST web service development you have to follow bottom up approach only that is generating the classes manually. NetBeans IDE provides certain wizards for creating REST web service quickly from databases, entity classes and patterns.
I had also seen when you are developing web service in eclipse and you are using wizard in eclipse IDE, you can create a REST web service from WSDL file. I found this very strange. My question here is what are the approaches we can have for creating REST web services. Can we create REST web services using top-down and bottom up approached. If yes then please provide me details.
Thanks.
It is possible to describe a REST service using a contract. This is the intent of WADL and WSDL 2.0. WADL is specifically a REST contract, whereas WSDL 2.0 evolved from the original WSDL spec. to support all HTTP bindings. Since REST services rely on the use of HTTP methods and headers to exchange messages a WSDL 2.0 contract can work. There is a really good explanation here: http://ajaxonomy.com/2008/xml/web-services-part-2-wsdl-and-wadl
For development of REST services, I'm not sure if NetBeans, Eclipse or other tools specifically support automated REST service from WSDL generation. I would imagine that most are still intended for SOAP service creation. At this point I think WSDL 2.0 and WADL can be used to describe a REST service, but are not intended for automated generation of a REST service.
REST services are simple HTTP request/response,and therefore don't require complex stubs. In most cases it would probably take more time to write the WSDL describing the REST service, than it would take to write the REST service itself.

Possible to create REST web service with ASP.NET 2.0

Is it possible to create a REST web service using ASP.NET 2.0? The articles and blog entries I am finding all seem to indicate that ASP.NET 3.5 with WCF is required to create REST web services with ASP.NET.
If it is possible to create REST web services in ASP.NET 2.0 can you provide an example.
Thanks!
I have actually created a REST web service with asp.net 2.0. Its really no different than creating a web page.
When I did it, I really didn't have much time to research how to do it with an asmx file so I did it in a standard aspx file. I know thier is extra overhead by doing it this way but as a first revision it was fine.
protected void PageLoad(object sender, EventArgs e)
{
using (XmlWriter xm = XmlWriter.Create(Response.OutputStream, GetXmlSettings()))
{
//do your stuff
xm.Flush();
}
}
/// <summary>
/// Create Xml Settings object to properly format the output of the xml doc.
/// </summary>
private static XmlWriterSettings GetXmlSettings()
{
XmlWriterSettings xmlSettings = new XmlWriterSettings();
xmlSettings.Indent = true;
xmlSettings.IndentChars = " ";
return xmlSettings;
}
That should be enough to get you started, I will try and post more later.
Also if you need basic authentication for your web service it can be done, but it needs to be done manually if you aren't using active directory.
It is definitely possible to create RESTful web services using ASP.NET. If you are starting a new project I would definitely look into creating RESTful web services using WCF. The 3.5 .NET Framework allows you to specify RESTful endpoint along with a regular old SOAP endpoint and still deliver the same service.
All you really have to do is enable an endpointbehavior that calls out <webHttp />
Here is a good series on creating RESTful web services using WCF:
http://blogs.msdn.com/bags/archive/2008/08/05/rest-in-wcf-blog-series-index.aspx
You can certainly create RESTful web services in ASP.NET 2.0, for example, but there are no high-level APIs to do all the donkey work for you, as provided by WCF in .NET 3.5.
Well, of course you could always implement the spec yourself. It's just that there's nothing built-in to support it. If you use Nathan Lee's solution, do it as an http handler (.ashx) rather than an aspx. You can just about copy/paste his code into a new handler file.
You can do RESTful web services easily by implementing the spec using IHTTPHandlers.
Also check out using ASP.Net MVC. I've written some articles on this at my blog:
http://shouldersofgiants.co.uk/Blog/
Look for my Creating a RESTful Web Service Using ASP.Net MVC series
I'm only just beginning to use them, but from what I've seen 2.0 pretty assumes SOAP.
You can create RESTful service using
1) WCF REST service
2) ASP.NET Web API
If you all care about RESTful service, ASP.NET web api is that you should go with. But if you need service that supports both SOAP webservice and RESTful then WCF REST would be a good choice.
There are some articles that discuss about one versus another. This article may be helpful.