Click here to take survey
Please click on the link below to help complete a questionnaire for my research project.
thanks for your participation
http://www.surveymonkey.com/s/HQLW7ND
Monday 18 April 2011
Tuesday 16 November 2010
The Processes i went through towards creating My web Service
I opened the Netbeans IDE that was installed on my laptop.
I created a New Project named "OnlineDatabaseService" by clicking on File from the menu then selected New Project from the windows dialogue box that came up i selected Java Web and then Web Application. i named my project OnlineDatabaseService, set it as the Main project then next to specify the server that i will be using to deploy the project and the path. so i selected the GlassFish v3 server from the window that was displayed. then finish and my project was automatically created in the netbeans IDE.
I proceeded to create my web service. I right-clicked on the OnlineDatabaseService project that was created, selected New then Web Service and named my Web Service OnlineDBWebService specified the package as server then selected the Create Web srvice from Scratch then finish. My Web Service was created with the Source and Design window being displayed on the coding area of the netbeans.
The next step was to create the database. I again right-clicked on the OnlineDatabaseService selected New then Entity Classes from Database. I selected the data Source as jdbc/sample then from the Available table i highlighted the Customer table and clicked on Add which took me to the next window where i specified the names and the location of the entity classes of my new table. This time around i change my source package for the database to database. Again i ticked the check box for Generate Named Query Annotations for Persistent Fields created the Persitence Unit which i named as OnlineDBWebServicePU then finish to create my Database for the project.
Next, I declared the operation parameters and initate the method. i clicked on the design tab on the coding area, on the window that was displyed i clicked on Add operation button. on the property window that was displayed i typed in the operation name as CustomerDBNumber then clicked on the Add button to add the parameters name which i declared as index and Type as int then ok.
Next, was to initiate the method calls. on the public class OnlineDBWebservice, i initated the PersistenceUnit and the EntityManagerFactory code (see practical coursework submitted to CITE, UEL). again i proceeded to the operation CustomerDBNumber with parameter index and initiated the method call for querrying the created database Customer (see practical coursework submitted to CITE, UEL).
My Web Service was good to go. so i deployed it to the server by right-clicking on the said Web Service project OnlineDatabaseService then select deploy to deploy the web Service on the Glassfish v3 server. The process displayed Build Succesful. to run the web service on the server, I right-clicked on the OnlineDBWebService then selected Test Web Service which took me to the browser where i viewed my Test page.
For the Screenshot of my Web Service (see practical coursework submitted to CITE, UEL)
I created a New Project named "OnlineDatabaseService" by clicking on File from the menu then selected New Project from the windows dialogue box that came up i selected Java Web and then Web Application. i named my project OnlineDatabaseService, set it as the Main project then next to specify the server that i will be using to deploy the project and the path. so i selected the GlassFish v3 server from the window that was displayed. then finish and my project was automatically created in the netbeans IDE.
I proceeded to create my web service. I right-clicked on the OnlineDatabaseService project that was created, selected New then Web Service and named my Web Service OnlineDBWebService specified the package as server then selected the Create Web srvice from Scratch then finish. My Web Service was created with the Source and Design window being displayed on the coding area of the netbeans.
The next step was to create the database. I again right-clicked on the OnlineDatabaseService selected New then Entity Classes from Database. I selected the data Source as jdbc/sample then from the Available table i highlighted the Customer table and clicked on Add which took me to the next window where i specified the names and the location of the entity classes of my new table. This time around i change my source package for the database to database. Again i ticked the check box for Generate Named Query Annotations for Persistent Fields created the Persitence Unit which i named as OnlineDBWebServicePU then finish to create my Database for the project.
Next, I declared the operation parameters and initate the method. i clicked on the design tab on the coding area, on the window that was displyed i clicked on Add operation button. on the property window that was displayed i typed in the operation name as CustomerDBNumber then clicked on the Add button to add the parameters name which i declared as index and Type as int then ok.
Next, was to initiate the method calls. on the public class OnlineDBWebservice, i initated the PersistenceUnit and the EntityManagerFactory code (see practical coursework submitted to CITE, UEL). again i proceeded to the operation CustomerDBNumber with parameter index and initiated the method call for querrying the created database Customer (see practical coursework submitted to CITE, UEL).
My Web Service was good to go. so i deployed it to the server by right-clicking on the said Web Service project OnlineDatabaseService then select deploy to deploy the web Service on the Glassfish v3 server. The process displayed Build Succesful. to run the web service on the server, I right-clicked on the OnlineDBWebService then selected Test Web Service which took me to the browser where i viewed my Test page.
For the Screenshot of my Web Service (see practical coursework submitted to CITE, UEL)
Monday 15 November 2010
Part 3 of My Coursework.... creating a Web Service
After Several Coding and Debugging i was able to come up with a Web Service that Accesses data from an Online Database.
Friday 12 November 2010
Deploying your Web Service to your Local server.
I encountered problems deploying and testing the sample web servive given to us by the tutor but after downloading and installling the GlassFish server 3.1. it worked. Now i can continue with my Coursework Task 3.
Thursday 11 November 2010
Making Your Web service Public
Annotation is important to make your Web service Public. and it is being declared as
import javax.jws.WebService
import javax.jws.WebMethod
import javax.jws.WebParam
import javax.jws.WebService
import javax.jws.WebMethod
import javax.jws.WebParam
Tuesday 9 November 2010
THINGS I FOUND OUT WHILE TRYING TO DO ACTIVITY 2 OF THE PRACTICAL COURSEWORK
1. Namespaces can be declared in the Elements where they are used or in the XML root element. Name conflicts in XML can easily be avoided using a name prefix. when trying to mix XML documents from different XML application there might be conflicts if the developer does not use the right prefix for the namespace.
A namespace is defined by the xmlns attributes in the start tag of an element. namespace declaration syntax is (xmlns:prefix="URI"). colons ":" are usedc to declare namespaces.
2. an XML Element is everything from (including) the element start tag to (including) the elements end tag. Elements can contain other elements, text or attributes. an instance of an attribute is
XML element names cannot contain spaces. XML elements are Extensible and that is one of the good characteristics of XML because it can be extended without breaking Applications.
A namespace is defined by the xmlns attributes in the start tag of an element. namespace declaration syntax is (xmlns:prefix="URI"). colons ":" are usedc to declare namespaces.
2. an XML Element is everything from (including) the element start tag to (including) the elements end tag. Elements can contain other elements, text or attributes. an instance of an attribute is
XML element names cannot contain spaces. XML elements are Extensible and that is one of the good characteristics of XML because it can be extended without breaking Applications.
Monday 8 November 2010
Setting Up Your PC to Run Java Applications eg Netbeans
Steps
1) Go to Control Panel
2) Select System and Maintenance
3) Select System
4) Select Advanced System Settings from the left side of the menu and click OK for Admin level access
5) Select Environment Variables
6) Scroll down under the system variables area (bottom half of screen) and select path.
7) Select Edit and go all the way to the end of the line. You need to add your path to the end. Make sure you place a semicolon before you entry. For me my path was as follows ";C:\Program Files\Java\jdk1.6.0_13\bin".
8) Select OK and you are ready to go.
1) Go to Control Panel
2) Select System and Maintenance
3) Select System
4) Select Advanced System Settings from the left side of the menu and click OK for Admin level access
5) Select Environment Variables
6) Scroll down under the system variables area (bottom half of screen) and select path.
7) Select Edit and go all the way to the end of the line. You need to add your path to the end. Make sure you place a semicolon before you entry. For me my path was as follows ";C:\Program Files\Java\jdk1.6.0_13\bin".
8) Select OK and you are ready to go.
Subscribe to:
Posts (Atom)