How to auto-generate Services proxy class from wsdl by wsdl.exe

  1. Create simple project , WCF client ‘ServiceClientCalculator’


2. right side pane, solution Explorer


3. Open the Command Prompt Visual Studio 2017 , and locate the directory to your project solution location : C:\Test\ServiceClientCalculator.



While do case and getopts shell script linux example

While do case and getopts shell script linux example

1. ‘ getopts ‘ is a syntax to get parse command line argument to our script , this also as an option of argument.

2. parse an argument -a, -b to the script.

while getopts “:ab” opt; do
case ${opt} in
a )
echo ” You choose : $option_a”
b )
echo ” You choose : $option_b”
\? ) echo “Usage: cmd [-a] [-b]”

How to Use Function in the shell script + logging using ‘ tee ‘ ?

1. Function in shell script .
– declare the function :
echo ” fndong ”

– called the function ‘ funct_name() ‘
echo ” Hello” funct_name
2. simple program called function + logging using ‘ tee ‘.

2.1. Directory structures
– <My_Directory> , your main directory in linux environment.
– <My_Directory>/config/

– <My_Directory>/

2.2. Source Bash shell script ‘ ‘
– using tee command to write to ‘ log.txt ‘
– ‘ setLogMsg() ‘ is a function.
– call the function ‘ setLogMsg ‘


echo “\$1 : $1”
echo “\$2 : $2”
echo “$1 : $2 ” | tee -a $LOGFILE


# main line code
# use source command to read the parameter key in properties

if [ -f ${config_dir}/ ];then
source ${config_dir}/
echo “test $mysite”
setLogMsg “INFO” $mysite
MSG_ERR=”There is no values in this properties ….”
setLogMsg ” ERROR ” ${MSG_ERR}
3. ‘tee’ command – ‘ echo “$1 : $2 ” | tee -a $LOGFILE ‘ in the method ‘ setLogMsg() ‘ its inserted echo values into ‘ log.txt ‘

Selamat mencuba.

How to read a parameter from properties file by shell script ?

I used ‘source’ syntax to called the parameter from property file.

1. create your directory on your linux OS environment.
– this <mydir> you need to change.



2. source bash file – ‘ ‘


# use source command to read the parameter key in properties
if [ -f ${config_dir}/ ];then
source ${config_dir}/
echo “$MESSAGE”
echo “Log directory $LOG_DIR”

3. properties file
– values:
Terima kasih,
Tubek blog ti…

Create Spring Boot + Restful Project

Hi Everyone,

Create Spring Boot + Restful Project – with Spring Initializr.

The Spring Initializr is a website that generated a Spring Boot Project structure.
By creating Spring Boot with this Spring Initalizr it will generate all the project details.
Its include the dependencies of your application such build file and contains all the dependencies and configuration for the project.



  1. Go to Spring initializr website, then add the Group and artifact you want.


  • Then Download by Click Button Generate Project, it will generate zip. file.

2. Unzip the project to your workspace, on Eclipse right-click import > Existing Maven Project.


Thread in Java.

1. What is Thread?
 1.a. Thread is a Light-weight ,its allow multiple activities within a single process.
 1.b. All treads of a process share the common memory space, The process of execution multiple threads simultaneously is known as multi-threading.

2. Non-Thread Program vs Thread Program

2.a. Example Non-Thread Program.

public class WithoutThread {

 // main method
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  String str = “banana”;
  String str2 = “papaya”;
  ProcessClass proStr = new ProcessClass();
class ProcessClass{
 public void IterateRandomValue(String itr){
  for (int i = 0; i < 5; i++) {
    System.out.println(i + ” ” + itr );

OUTPUT in Console:
0 banana
1 banana
2 banana
3 banana
4 banana
0 papaya
1 papaya
2 papaya
3 papaya
4 papaya

Descriptions on without Thread class : without added thread class, it will execute the process one by one ( check the output program above, program banana will run first until its finish, and then, papaya program will be run ) – sequentially. the Process will taking longer time to finish the processing compare than extends Thread class or implements Runnable class.

2.b. Thread Program.

  • the Functions of Java Threads is to allow multiple activities within a single process.
  • To implement The Threads function we need to extends Thread Class or Implements Interface Runnable Class.

Example Program extend Thread class.

public class ThreadExample {
 //Main Thread
    public static void main(String[] args)
     // TODO Auto-generated method stub
     String str = “banana”;
     String str2 = “papaya”;
     // First Thread
     ExtendThread firstThread = new ExtendThread(str);
        //Second Tread
     ExtendThread secondThread = new ExtendThread(str2);


class ExtendThread extends Thread
 private String strNew;

 ExtendThread(String str) {
  strNew = new String(str);

 public void run() {
  for (int i = 0; i < 5; i++) {
   System.out.println(i + ” ” + strNew);


Starting Banana
Creating ..Papaya
Starting Papaya
Thread : Banana,4
Thread : Papaya,4
Thread : Banana,3
Thread : Papaya,3
Thread : Banana,2
Thread : Papaya,2
Thread : Banana,1
Thread : Papaya,1

  • If we see the results for (papaya,1) and (Banana, 1) its actually run simultaneously
  • How to Use ServletOutputStream – for Servlet Download zip file into response Client?

    Good Day!

    How to Use ServletOutputStream – for Servlet Download zip file into response Client?

    Description / Answer:

    • from the lib descriptions – Provides an output stream for sending binary data to the client.
    • is an abstract class that the servlet container implements. Subclasses of this class must implement the method.
    • method that are regularly used are : .write() – writing what the client request and paste to servlet response client.
    • Its use to attached the Output Stream to download on browser.

    example program – Servlet Class :

    ServletOutputStream servletOutputStream = null;
    FileInputStream fileInputStream = null;
    filename = “documentInput.Zip“;

    try {
    File file = new File(“C://documents/temp/“);
    fileInputStream = new FileInputStream(file);
    servletOutputStream = response.getOutputStream();

    // download using browser client – change to byte
    response.addHeader(“Content-Disposition“,”attachment;filename=\“” + filename + “\””);
    byte[] arBytes = new byte[32768];

    int count;
    while ((count = > 0)
    servletOutputStream.write(arBytes, 0, count);

    }catch (IException e) {
    // TODO: handle exception
    } finally{

    How to add compare function in Notepad++

    Hi Good Day , 你好! , Anih Agah , Nama rita Nuan,

    How to add compare function in Notepad++

    1. Open your Notepad++ , then go to menu Tab on the Top, Plugin Manager > Show Plugin Manager , Search for compare.


    2. Tick the compare option, click Install – & Yes if you want to Update , or No if you don’t want to update your Notepad++.


    3. After done Installed the plugin, then you can open your two files you want to compare, then at the first file – go to Tab and click Plugins > Compare > Compare (click it) or shorcut key – CTRL+ALT + C,


    4. Above image show comparison between two files source codes. with + green show there are new line , and – minus is empty. 

    5. If you guys using notepad ++ v.7.3.3 , its doesn’t have any top tab plugins, so what you must do is, install manually.

    on your Directory installer : Notepad++\plugins

    create your folder such as \config

    then download this notepad compare plugin from Github. add this downloaded files to Notepad++\plugins\config\


    After that, go to notepad++ application, click on ( Settings > import > import Plugin(s).. ) the go plugin directory and get the comparePlugin.dll.

    Then you can use the comparator plugin. 

    Selamat Mencuba , Good Luck !