WS LAB MANUAL + Formatted

Embed Size (px)

Citation preview

  • 8/7/2019 WS LAB MANUAL + Formatted

    1/36

    Aim : Installing Wordpress Locally

    Procedure:

    1) Install Wamp

    This tutorial is designed to Wamp but it could work perfectly with any other local serverincluding PHP and MySQL.

    If your site should use seo-friendly permalinks, with the option /%postname%, they will notwork locally unless the rewrite module is enabled.To activate it, open the Wamp menu, open Apache, Apache modules and check onrewrite_module.

    2) Install Wordpress

    Unpack the Wordpress archive in /wamp/www/wordpressIt is also possible to use virtualhost to install multiple sites, but that is another matter.

    3) Create a database

    For this, we enter in phpMyAdmin from the Wamp menu in the taskbar, and inphpMyAdmin, we click on the "Create a database" link after entering the name chosen for thebase in the input field below the link.

    4) Fill wp-config.php

    ?php// ** MySQL settings ** //define('DB_NAME', 'wordpress');define('DB_USER', 'root');

    define('DB_PASSWORD', '');define('DB_HOST', 'localhost');define('DB_CHARSET', 'utf8');define('DB_COLLATE', '');

    // You can have multiple installations in one database if you give each a uniqueprefix$table_prefix = 'wp_'; // Only numbers, letters, and underscores please!

    // Change this to localize WordPress. A corresponding MO file for the// chosen language must be installed to wp-content/languages.// For example, install de.mo to wp-content/languages and set WPLANG to 'de'// to enable German language support.

    1

    http://www.wampserver.com/http://www.wampserver.com/
  • 8/7/2019 WS LAB MANUAL + Formatted

    2/36

    define ('WPLANG', 'fr_FR');define('WP_POST_REVISIONS',false);

    /* That's all, stop editing! Happy blogging. */

    define('ABSPATH', dirname(__FILE__).'/');require_once(ABSPATH.'wp-settings.php');?>

    This file is at the root of wordpress. Rename wp-config-example.php in wp-config.php.

    The name of the database (DB_NAME): it is that you created with phpMyAdmin."wordpress" is an example.The username (DB_USER): rootThe password: none.The server (DB_HOST): localhost.The charset: you choose, the default is utf8.The language you choose, nothing for English otherwise enter the code, for example fr-FRand install the corresponding mo file into /wp-includes/languages/.The revisions: disable them is your site does not work as a wiki, to avoid to overload thedatabase.

    5) Start

    Click on localhost in the Wamp menu. Click on wordpress. An error message appears, youmust specify the full path:

    http://localhost/wordpress/wp-admin/install.php

    This can be done directly by typing this URL in the navigation bar of the browser.

    2

  • 8/7/2019 WS LAB MANUAL + Formatted

    3/36

    INSTALLATION SCREEN SHOTS

    3

  • 8/7/2019 WS LAB MANUAL + Formatted

    4/36

    4

  • 8/7/2019 WS LAB MANUAL + Formatted

    5/36

    OUTPUT

    5

  • 8/7/2019 WS LAB MANUAL + Formatted

    6/36

    Then click on install, and it is finished.

    Importing the content of a blog

    If you already have a blog online, you can retrieve its content with the export command onthe site, and import it locally. This can be particularly useful to verify the compatibility of anew version of Wordpress with the database before installing it.

    In this case, you have to increase the memory size allowed to PHP in the php.ini file in thephp subdirectory of Wamp:

    memory_limit = 64M ; Maximum amount of memory a script may consume (8MB)

    Aim : Installing Joomla Locally

    6

  • 8/7/2019 WS LAB MANUAL + Formatted

    7/36

    Procedure:

    1. Create a new folder called joomla within the WWW folder of your wamp server ( The

    www folder on your wamp server is where all your new project folders and files must be put).

    2. Extract all the files from the downloaded joomla zip folder and insert them into the newly

    created joomla folder within the WWW wamp folder or directory.

    3. Edit the configuaration.php-Dist file within the extracted joomla file ( You will see this file

    by just opening up the joomla folder within the WWW wamp folder ) and delete everything

    in this file and rename it configuration.php

    4. Left click on your wamp icon and click on the localhost panel.Within the projects section

    you will see your joomla folder and by just clicking on it this will bring up the joomla

    installation.

    5. Joomla installation steps (a) select language,click on english and then click next (b) pre-

    installation check,just leave as it is and click next (c) license,just click next (d) database

    configuration ( this will be the same as that used in configurating your database within the

    phpMyAdmin panel within wamp see step 6 above ) for example my

    sql,hostname=localhost,username=what you created,password=what you created,database

    name=what you created and then just click next (e) FTP configuration,just leave as it is and

    click next.(f) Main configuration,sitename : can be any name that you want, --- confirm email

    and password : use the email that you used to install the wamp server and create an admin

    password for accessing your joomla control panel.(g) Load sample data,tick install sample

    data and click next.You have now successfully completed your installation.

    6. The final step involves deleting the entire contents of the joomla installtion folder.Just

    navigate to the WWW directory or folder and open up the joomla folder and delete its

    installation folder.Thats it,you are finished.

    7

    http://www.articlealley.com/http://www.articlealley.com/http://www.articlealley.com/http://www.articlealley.com/http://www.articlealley.com/http://www.articlealley.com/
  • 8/7/2019 WS LAB MANUAL + Formatted

    8/36

    INSTALLATION SCREEN SHOTS

    8

  • 8/7/2019 WS LAB MANUAL + Formatted

    9/36

    9

  • 8/7/2019 WS LAB MANUAL + Formatted

    10/36

    10

  • 8/7/2019 WS LAB MANUAL + Formatted

    11/36

  • 8/7/2019 WS LAB MANUAL + Formatted

    12/36

    12

  • 8/7/2019 WS LAB MANUAL + Formatted

    13/36

    OUTPUT

    13

  • 8/7/2019 WS LAB MANUAL + Formatted

    14/36

    Aim : Develop a simple web service to display Hello World.

    14

  • 8/7/2019 WS LAB MANUAL + Formatted

    15/36

    Description :

    Creating Apache Axis2 Web Services on NetBeans IDE

    This experiment shows you how to create and deploy an Apache Axis2 web service from a

    Java class. You also learn how to set up the Tomcat and the GlassFish servers bundled with

    NetBeans IDE to deploy Axis2 web services. The tutorial also shows how to configure the

    Axis2 options in the IDE so that the IDE deploys Axis2 web services correctly.

    Apache Axis is an implementation of the SOAP (Simple Object-Access Protocol) submission

    to the W3C. Apache Axis2 is a more efficient, more modular and more XML-oriented

    version of Axis. Axis2 not only supports SOAP 1.1 and SOAP 1.2, but it also has integrated

    support for RESTful web services. The same business logic implementation can offer both a

    WS-* style interface as well as a REST/POX style interface simultaneously. For more

    information about Axis2, please see the Apache.org website.

    Axis2 web services are interoperable with Metro. You can create a JAX-WS client for an

    Axis2 web service, although some more complicated Axis2 WSDL operations may not be

    supported.

    Software or Resource Version Required

    NetBeans IDE Java download bundle

    Java Development Kit (JDK)version 6 or version 5

    Warning: NetBeans IDE 6.9 requires JDK 6

    Apache Axis 2 version 1.3 or later, WAR distribution

    Java EE-compliant web or application

    server

    Tomcat web server 6.0 and/or

    GlassFish Server Open Source Edition 2.1 or

    3.0.1

    15

    http://ws.apache.org/axis2/http://www.netbeans.org/downloads/index.htmlhttp://java.sun.com/javase/downloads/index.jsphttp://ws.apache.org/axis2/download.cgihttp://ws.apache.org/axis2/http://www.netbeans.org/downloads/index.htmlhttp://java.sun.com/javase/downloads/index.jsphttp://ws.apache.org/axis2/download.cgi
  • 8/7/2019 WS LAB MANUAL + Formatted

    16/36

    Both Tomcat and the GlassFish server can be installed with the Java Web distribution of

    NetBeans IDE. Alternatively, you can visit the the GlassFish server downloads page or the

    Apache Tomcat downloads page.

    Setting Up Axis2 and NetBeans IDE

    In this section you learn how to download an Axis2 WAR file, embed it in either an Apache

    Tomcat or the GlassFish server, and configure NetBeans IDE to upload AAR files to the

    server.

    Downloading the Apache Axis2 WAR file

    Apache Axis2 can be downloaded here. Download the WAR (Web Archive) distribution, so

    you do not have to build the WAR file yourself. The download is in the form of an archive

    file. Later you unpack the archive to your server.

    Installing the Axis2 Support Plugin

    This tutorial requires the Axis2 Support plugin for the NetBeans IDE. In the IDE, go to the

    Plugin Manager, under the Tools menu, and check whether Axis2 Support Plugin is installed,

    under the Installed tab. If it is installed, check whether an update is available in the Updates

    tab. If the Axis2 support is not installed, install it from the Available Plugins tab, as shown

    below.

    16

    https://glassfish.dev.java.net/public/downloadsindex.htmlhttp://tomcat.apache.org/download-60.cgihttp://ws.apache.org/axis2/download.cgihttps://glassfish.dev.java.net/public/downloadsindex.htmlhttp://tomcat.apache.org/download-60.cgihttp://ws.apache.org/axis2/download.cgi
  • 8/7/2019 WS LAB MANUAL + Formatted

    17/36

    Setting Up Axis2 Options for Tomcat

    Axis services run faster on Tomcat than on the GlassFish server, but the setup is slightly

    more complicated. You can easily deploy the same service to both Tomcat and the GlassFish

    server by first deploying to one server, then changing the Axis2 options and finally deploying

    to the other server.

    If you want to deploy to the GlassFish server instead of Tomcat, go to Setting Up Axis2

    Options for the GlassFish server.

    To set up Axis2 options for Tomcat:

    1. Unpack the downloaded archive file containing axis2.war to your Tomcat

    CATALINA_BASE/webapps directory. If you do not know where your

    CATALINA_BASE is, start the IDE and open the Services tab. Expand the Servers

    17

    http://netbeans.org/kb/docs/websvc/gs-axis.html#axis_options_glassfish%23axis_options_glassfishhttp://netbeans.org/kb/docs/websvc/gs-axis.html#axis_options_glassfish%23axis_options_glassfishhttp://netbeans.org/kb/docs/websvc/gs-axis.html#axis_options_glassfish%23axis_options_glassfishhttp://netbeans.org/kb/docs/websvc/gs-axis.html#axis_options_glassfish%23axis_options_glassfish
  • 8/7/2019 WS LAB MANUAL + Formatted

    18/36

  • 8/7/2019 WS LAB MANUAL + Formatted

    19/36

    4. Click the Axis2 icon. The Axis2 deployment options page opens.

    19

  • 8/7/2019 WS LAB MANUAL + Formatted

    20/36

    5. Set the target location for Axis2 AAR files to your CATALINA_BASE (not

    TOMCAT_HOME)/ webapps/axis2 directory.

    6. Make sure the Axis2 URL field contains the correct port number for your Tomcat

    server. To check the port number, start Tomcat (from the Services tab or from Tools

    20

  • 8/7/2019 WS LAB MANUAL + Formatted

    21/36

    -> Servers) and see what port Coyote HTTP/1.1 uses.

    7. For convenience, select Use Tomcat Manager for Deployment. This function means

    that the IDE will launch Tomcat Manager in the background and run the reload

    command on axis2.war every time you make a change to axis2.war. If you do not

    select Use Tomcat Manager for Deployment, you will have to manually run Tomcat

    Manager or use other Tomcat tools to reload axis2.war every time you make a change

    to it.

    The default Tomcat Manager username and password varies. You can find this

    information in the Properties page for the Tomcat serverTo double-check that Tomcat

    Manager is deployed and has the default manager role username and password, open

    CATALINA_BASE/conf/tomcat-users.xml. The manager role should be defined and

    it should have a username and password assigned to it, as in the following version of

    the file. (You can copy and paste this file if necessary.)

    21

    http://netbeans.org/kb/docs/websvc/gs-axis.html#copy_war%23copy_warhttp://netbeans.org/kb/docs/websvc/gs-axis.html#copy_war%23copy_war
  • 8/7/2019 WS LAB MANUAL + Formatted

    22/36

    Setting Up Axis2 Options for the GlassFish server

    You can deploy Axis2 web services to the GlassFish Server Open Source Edition. You can

    easily deploy the same service to both Tomcat and the GlassFish server by first deploying to

    one server, then changing the Axis2 options and finally deploying to the other server.

    If you want to deploy to Tomcat instead of the GlassFish server, go to Setting Up Axis2

    Options for Tomcat.

    To set up Axis2 options for the GlassFish server:

    1. Unpack the downloaded archive file containing axis2.war to

    GLASSFISH_HOME/domains/DOMAIN_NAME/autodeploy. To find the

    GLASSFISH_HOME and the name of your domain, start the IDE and open the

    Services tab. Expand the Servers node. Right-click the GlassFish server 2.1 or 3.0.1

    node and select Properties from the context menu. The Domains folder location and

    the name of the domain are visible in the Connection tab. For example, from the

    following image, you know to copy axis2.war to G:\GlassFish-

    22

    http://netbeans.org/kb/docs/websvc/gs-axis.html#axis_options_tomcat%23axis_options_tomcathttp://netbeans.org/kb/docs/websvc/gs-axis.html#axis_options_tomcat%23axis_options_tomcathttp://netbeans.org/kb/docs/websvc/gs-axis.html#axis_options_tomcat%23axis_options_tomcathttp://netbeans.org/kb/docs/websvc/gs-axis.html#axis_options_tomcat%23axis_options_tomcat
  • 8/7/2019 WS LAB MANUAL + Formatted

    23/36

    2.1ur2\domains\domain1\autodeploy.

    2. Start the IDE. From the top menu bar, choose Tools -> Options. The Options dialog

    opens.

    23

  • 8/7/2019 WS LAB MANUAL + Formatted

    24/36

    3. Click the Axis2 icon. The Axis2 deployment options page opens.

    24

  • 8/7/2019 WS LAB MANUAL + Formatted

    25/36

    4. Set the target location for Axis2 AAR files to the axis2.war file you unpacked into the

    GlassFish server autodeploy directory.

    By placing axis2.war into autodeploy, you enable the GlassFish server to

    automatically redeploy axis2.war every time you alter the file. On the GlassFish

    server 3.0.1 Prelude, however, you cannot redeploy the WAR file while the server is

    running.

    5. Make sure the Axis2 URL field contains the correct port number for your GlassFish

    server. To check the port number, start the GlassFish server (from the Services tab or

    from Tools -> Servers) and see what 80xx port HTTP 1.1 uses. The default port

    number is 8080. In the following image, the correct port number is 8081 (because

    25

  • 8/7/2019 WS LAB MANUAL + Formatted

    26/36

    another server already uses 8080).

    Note: If you are using Windows Vista, have the GlassFish server installed to Program Files,

    and have User Access Control enabled, you will not be able to make changes to the axis2.war

    file from the IDE. Either install the GlassFish server to a different location or disable UAC.

    Developing an Axis2 Web Service

    In this section, you use NetBeans IDE to create, deploy, test, and modify an Axis2 web

    service.

    Creating an Axis2 Web Service

    With NetBeans IDE, you can create an Axis2 web service from a Java class. You can only do

    this from a Java application or Java library project. In this tutorial, you create a Java library

    project (because you do not need a main method), create an Axis2 web service in that project

    (creating the Java class at the same time) and deploy the Axis2 web service to a server.

    You can only create an Axis2 web service from a Java or Java Library project. This is

    because the axis.aar file (the deployable archive into which web services and Axis

    26

  • 8/7/2019 WS LAB MANUAL + Formatted

    27/36

    configuration files are packed) is neither a WAR nor an EAR and cannot be deployed

    normally as a web (EAR) application.

    To create an Axis2 web service:

    1. Click the New Project icon or File -> New Project. The New Project wizard opens.

    From the Java category, select a Java class library project. Click Next.

    2. Name the project AxisHello. Check that you are using the project folder name and

    location that you want. It is up to you whether to share the project. Click Finish, and

    the IDE creates the project.

    3. Right-click the project node. The context menu opens. In the context menu, choose

    New -> Other. The New File wizard opens. From the Web Services category, choose

    27

  • 8/7/2019 WS LAB MANUAL + Formatted

    28/36

    Axis2 Service from Java and click Next.

    4. The Service Type Selection page of the New File wizard is now open. You do not

    have any Java classes in the project, so select "Create an Empty Web Service." If you

    28

  • 8/7/2019 WS LAB MANUAL + Formatted

    29/36

  • 8/7/2019 WS LAB MANUAL + Formatted

    30/36

    respectively.

    Deploying and Testing an Axis2 Web Service

    Once you have created an Axis2 web service, you need to deploy it to a server. Actually,

    deployment to a server involves two steps:

    30

  • 8/7/2019 WS LAB MANUAL + Formatted

    31/36

    1. Copying the Axis2 web service to the axis2.war file used by the server. This step can

    be taken with the server offline.

    2. Redeploying the updated axis2.war file to the server.

    If you are deploying to Tomcat with the Use Tomcat Manager for Deployment option

    enabled (see Setting Up Axis2 Options for Tomcat), or you are deploying to the GlassFish

    server and axis2.war is in the GLASSFISH_DOMAIN/autodeploy folder (see Setting Up

    Axis2 Options for the GlassFish server), the updated axis2.war is automatically redeployed to

    the server. Otherwise, you have to redeploy axis2.war manually, using application server

    tools. In this tutorial we assume you have set up the Axis2 options so redeployment is

    automatic.

    To deploy an Axis2 web service to the server:

    1. Right-click the web service's node. The context menu opens. Select Deploy to Server.

    The IDE compiles an Axis2 AAR file and copies it to the axis2.war file used by the

    application server.

    2. If you have enabled automatic deployment, the web service is deployed to the server.

    If the server is not running, start it and the web service is automatically deployed.

    31

    http://netbeans.org/kb/docs/websvc/gs-axis.html#axis_options_tomcat%23axis_options_tomcathttp://netbeans.org/kb/docs/websvc/gs-axis.html#axis_options_glassfish%23axis_options_glassfishhttp://netbeans.org/kb/docs/websvc/gs-axis.html#axis_options_glassfish%23axis_options_glassfishhttp://netbeans.org/kb/docs/websvc/gs-axis.html#axis_options_tomcat%23axis_options_tomcathttp://netbeans.org/kb/docs/websvc/gs-axis.html#axis_options_glassfish%23axis_options_glassfishhttp://netbeans.org/kb/docs/websvc/gs-axis.html#axis_options_glassfish%23axis_options_glassfish
  • 8/7/2019 WS LAB MANUAL + Formatted

    32/36

    3. To test the service, expand the web service node to reveal the operations. Right-click

    the hello:String node and select Test Operation in Browser.

    32

  • 8/7/2019 WS LAB MANUAL + Formatted

    33/36

    4. Your browser opens with a test value of your variables. The test value is appended to

    the URL.

    33

  • 8/7/2019 WS LAB MANUAL + Formatted

    34/36

    5. Change the variable value in the URL and press Enter. The test result changes as well.

    Changing the Web Service's Operations

    To change the web service operations, edit the Java file in the project. The operations in the

    web service change simultaneously. Add a simple add method to HelloAxisWorld.java, as

    below.

    public class HelloAxisWorld {

    /** Sample method

    */

    34

  • 8/7/2019 WS LAB MANUAL + Formatted

    35/36

    public String hello(String name) {

    return "Hello "+name;

    }

    public int add(int x, int y) {

    return x+y;

    }

    }

    35

  • 8/7/2019 WS LAB MANUAL + Formatted

    36/36