Thursday, May 29, 2014

Hello World program in Web Service in Java using NetBeans IDE

Hi Guys,
Today i am going to describe you how to write a simple hello world program in web services using java in NetBeans IDE.

First we need to create the service.

For that, first create a new "Web Project" from "Java EE".

Then create an Interface class file named IHelloWOrld.java and write the below code
package com.hello;

import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.xml.ws.WebServiceException
@WebService
public interface IHelloWorld{
@WebMethod
public String hello() throws WebServiceException;
}
Then, create another class file named HelloWorld.java

Then write the code below


package com.hello; import javax.jws.WebMethod; import javax.jws.WebService; import javax.xml.ws.WebServiceException; @WebService public class HelloWorld implements IHelloWorld{ @WebMethod public String hello() throws WebServiceException{ return "Hello World"; } }
After that, create another project either standalone or a web project for service consumer/client side.
Here I am describing as a standalone application.
Then create a Web Service Client file and give the project name of the above service provider and package same as the above which we gave as "com.hello" and click on finish.
Then the stubs are generated for u to develop the consumer code or application.
Then create a class file and write the below code.
import com.java.HelloWorldService;
import com.java.HelloWorldPort;

public class HelloWorldClient{
public static void main(String args[]){
HelloWorldService service=new HelloWorldService();
HelloWorldPort port=service.getHelloWorldPort();
String hello=port.hello();
System.out.println(hello);
}
}

Online Libraries for Students, Teachers and Researchers

Have you grown tired asking Google to find eBooks for you? Then why not directly go to online libraries with thousands and millions of collections entirely focused for books? That’s the reason why I gathered the 8 best online libraries that students, teachers, and researches can use freely. Millions of books, hundreds of categories, and definitely for free! Enjoy!

1. Project Gutenberg

To start our list, Project Gutenberg was founded by Michael S. Hart, inventor of the now popular eBook, a project that seeks to provide free information on the internet with the use of eBooks. The early contents of the project were mostly typed by Hart, and now a large community is behind its continuing success. Being the first eBook library, it may also have the largest collection.

2. The Free Library

The Free Library contains several millions of articles and books, with the topic of Business having over 15 million articles and books in their library. Other categories include Law, Recreation, Humanities, Health, Science, Entertainment, Communications, and a lot more.

3. Planet eBook

 Although Planet eBook is not really a large library of free books, it makes up for it by focusing on classic books and novels ranging from George Orwell’s 1984 to Emily Bronte’s Wuthering Heights. In total Planet eBook has 82 free classic books and novels that you can download and read.

4. LibriVox

LibriVox is a one-of-a-kind project going around online, it is run by volunteers who read and record books so that people who are more acquainted with listening can enjoy the resources available in their catalog. All of the resources in LibriVox are in the public domain, meaning they’re free for use for most purposes.

5. Wikibooks

Yep, Wikibooks is one of Wikipedia’s sister sites, and is run completely ad-free and mostly by volunteers. Unlike other online libraries, Wikibooks only lists instructional books and both fiction and non-fiction are not allowed. If you are a student, or a teacher, then Wikibooks will prove very useful to you. While Wikibooks does not cater novels, it certainly does provide free information about mathematics, languages, sciences, engineering, and a lot more.

6. Scribd

Scribd is a different way of reading online, since it fuses reading with social media (Facebook, Twitter, and others). Scribd has a large collection of free books which range from novels down to amateur-written books, instructables, music sheets, and just about anything that can be read. You can also keep track of the things you read, share them to your friends via Facebook, and learn what’s entertaining and useful based on user reccomendations

7. Ibiblio

Ibiblio presents a wide variety of topics such as art, science, history, culture, and many more. All of the books, and software, are free for use. Ibiblio proclaims itself as the largest “collections of collections” on the internet.

8. GetCited

 GetCited is an online academic resource that teachers, students, and researchers can use to find a wide range of academic papers, reviews, conference papers, book chapters, and journals.