Saturday, May 23, 2015

Simplest JAX-WS Client

/*
Copyright (C) 2014 saminda konkaduwa
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail.
*/



Introduction

Easy JAX-WS SOAP client is a simplified web service client that reduces burden of creating painful web service client stubs that also eliminates use of external java libraries. You can invoke JAX-WS web services with faster, easier with few lines of java codes.

Advantages of Easy JAX-WS client

1. You can invoke web services using few lines of java codes with out creating
  massive and bulky client stubs.
2. Increase the speed of execution since there is no validation of web service
  requests with WSDL and no external libraries.
3. Simplified way to read complex responses.

Capabilities of Easy JAX-WS client

1. Can invoke HTTP based web service
2. Can invoke HTTPS based web service
3. Can incorporate HTTPS certificate files
4. Can incorporate with proxy host, ports, username, password
5. Can incorporate with application server level authentications

Steps to invoke JAX-WS web services using Easy JAX-WS client

1. Invoke the web service using your popular soap reader.
    Ex – SoapUI , Firefox SOA Client
2. View the structure of SOAP Request
3. View the WSDL file and read the SOAP action relevant to your Method
4. Build your SOAP Request using Easy JAX-WS client
5. Read the SOAP Response using Easy JAX-WS client

Lets tryout bellow examples 

1. HTTP based JAX-WS web service
2. HTTPS based JAX-WS web service
3. Incorporating proxy servers
4. Server authentications 

Simplest JSP Tree Viewer

Copyright (C) 2012  saminda konkaduwa, skonkaduwa@gmail.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program.  If not, see .

Also add information on how to contact you by electronic and paper mail.

@author Saminda Konkaduwa , skonkaduwa@gmail.com
@version 1.0
@since 10/April/2012





Download Location

http://sourceforge.net/projects/jsptree-simple/


Introduction

This is a simple JSP tree viewer with minimum usage of Java Scripts.       
Nodes are generated using parent child relationships.
Each node may have list of children nodes.


How to deploy

Prerequisites

1. You should know what is Java web application and How to deploy Java Web application project in your web server.
2. You should know how to install latest Java, MySQL Server and Apache Tomcat Server in your operating system

Deploy and run the given WAR file

1. Install latest Java version, MySQL server version, Apache Tomcat Server version.
2. Download the source code from http://sourceforge.net/projects/jsptree-simple/
3. Run the SQL statements given by SQLFile.txt on your MySQL server.
4. Open the given simple-jsp-tree.war file located at WebContent folder using zip / rar utilities. ( Becaues you can edit the war file content after open it by zip )
5. Find the config.properties located at simple-jsp-tree.war/WEB-INF/classes/com/jsptree/tags/config.properties.
6. Change config.properties according to your MySQL database server connectivity.
7. Save the changes on config.properties and exit from zip / rar utilities.
8. Then deploy simple-jsp-tree.war in your Apache Tomcat Server.
9. Access the simple JSP tree from http://localhost:8080/simple-jsp-tree

For Oracle Users

For Oracle JDBC Connection, Please override config.properties entries as with your Oracle database connection as follows.

jdbc.driver=oracle.jdbc.xa.client.OracleXADataSource
jdbc.connection.url=jdbc:oracle:thin:@localhost:1521:xe       
jdbc.username=oracle_user                                   
jdbc.password=oracle@123                                   

( NOTE  : xe is my database name. Change it to your Oracle database name )
( NOTE : oracle_user is my Oracle user name. Change it to your oracle user name )
( NOTE : oracle@123 is my Oracle password. Change it to your oracle password )                       
                       
                       
To run from source code from Your Favorite IDE

1. Install latest Java version, MySQL server version, Apache Tomcat Server version and your favorite Java Development IDE. ( Ex- Eclipse, Netbean)
2. Download the source code from http://sourceforge.net/projects/jsptree-simple/
3. Open your favorite Java Development IDE. ( Ex- Eclipse, Netbean)
4. Create simple JSP project.
5. Go to the downloaded source code and extract in to separate folder.
6. Copy the content of src folder to java source location of your JSP project.
7. Go to the downloaded source code again and copy the content of WebContent folder to web content of your JSP project.
8. Run the project using your favorite web server.

For Oracle Users

For Oracle JDBC Connection, Please override config.properties entries as with your Oracle database connection as follows.

jdbc.driver=oracle.jdbc.xa.client.OracleXADataSource
jdbc.connection.url=jdbc:oracle:thin:@localhost:1521:xe       
jdbc.username=oracle_user                                   
jdbc.password=oracle@123                                   

( NOTE  : xe is my database name. Change it to your Oracle database name )
( NOTE : oracle_user is my Oracle user name. Change it to your oracle user name )
( NOTE : oracle@123 is my Oracle password. Change it to your oracle password )       


Thank you.   

Source Code Installation of Apache Web Server On Linux

In-order to get the true satisfaction, trill and software freedom from Linux , let's install Apache web server from source code on Linux Platform

These installation conducted with up-to date software packages and operating system as of 23rd May 2015. Any future changes to the installation process are not included.


Operating System used             - CentOS 6
Compatible Operating Systems - Fedora, RedHat Linux

Pre-installations and updates

1. Perform a full system update


   Login as root user
   Command : su
                      Enter password of root user and it gives you root shell
   Command : yum update


2. Install GNU C and C++ compilers

 
    Login as root user if not
    Command : yum install gcc*

3. Create a directory called LAMP in your preferred place.
 
     Command : mkdir LAMP

4. We are going to download all source codes into this location.
    Now change the present working directory to LAMP


    Command : cd LAMP

5. Download and extract apache web server source code from   

    http://httpd.apache.org/download.cgi

6. Extract it.

    Command : tar -xvzf httpd-2.4.12.tar.gz

7. Download and extract apache web server run time utilities from 
    https://apr.apache.org/download.cgi

   There are two libraries called APR and APR-Util.
   Extract them.


   Command : tar -xvzf apr-1.5.2.tar.gz
   Command : tar -xvzf apr-util-1.5.4.tar.gz


8. Move apr and apr-util folders in to srclib directory of apache server source code directory

   Command : mv apr-1.5.2 httpd-2.4.12/srclib/apr
   Command : mv apr-util-1.5.4 httpd-2.4.12/srclib/apr-util



9. Build the source code and install

     9.1. Login as root user if not
     9.2. Configure the source code, remember that --prefix= notation says the installation location


Command : ./configure --prefix=/usr/local/apache --enable-so --enable-deflate --enable-headers --enable-rewrite --with-included-apr --with-included-apr-util

  It gave bellow build error due to dependency errors. "configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/". It may be different build error in your machine.You have to download dependent software and install it before you install apache. Some times dependent software may be depend on another new software. So you have to first find the dependency tree and then install all these dependencies.

Read the errors carefully and get the idea and search on the web

   9.3.1 Download pcre library source code and extract them to LAMP directory    
           
            Login as root user if not
            
            Extract source code
            Command : unzip pcre-8.37.zip
           
            Change current directory to your pcre-8.37
            Command : cd pcre-8.37
          

            Configure the source code
            Command : ./configure --prefix=/usr/local/pcre
           

            Build the source code
            Command : make

            Install it
            Command : make install

In my machine it gave bellow build error due to dependency issues "configure: error: mod_deflate has been requested but can not be built due to prerequisite failures"

Read the errors carefully and get the idea and search on the web

     9.3.2 Download zlib library source code and extract them to LAMP directory
          
             Login as root user if not

             Extract the source code
             Command : tar -xvzf zlib-1.2.8.tar.gz

             Change current directory to your zlib-1.2.8
             Command : cd zlib-1.2.8

             Configure the source code
             Command : ./configure --prefix=/usr/local/zlib

             Build the source code
             Command : make
            
             Install it
             Command : make install
  


10. Now reconfigure apache source code with mentioning newly installed dependencies

   Login as root user if not

   Change current directory to httpd-2.4.12
   Command : cd httpd-2.4.12
  
   Configure the source code
   Command : ./configure --prefix=/usr/local/apache --enable-so --enable-deflate --enable-headers --enable-rewrite --with-included-apr --with-included-apr-util --with-pcre=/usr/local/pcre/bin/pcre-config --with-z=/usr/local/zlib/
  
   Build the source code
   Command : make

   Install it
   Command : make install


11. If there are no errors then you have successfully installed apache web server from the source code.

12. Now change your directory to apache server location.

   Command : cd /usr/local/apache/bin

13. Start apache web server by bellow command

 Login as root user if not
 Command : ./apachectl start

14. Open your web browser and browse bellow url to check web server is working fine

 Command : http://localhost:80

15. If it shows we page with "It works!", 
      Then you have successfully installed apache web server.

16. Stop apache web server by bellow command
 
  Login as root user if not 
  Command : ./apachectl stop

17. Restart apache web server by bellow command

   Login as root user if not 
   Command : ./apachectl restart



Thank you.. Next we install MySQL and PHP from source code.