The purpose of life is not to win. The purpose of life is to grow and to share. When you come to look back on all that you have done in life, you will get more satisfaction from the pleasure you have brought into other people's lives than you will from the times that you outdid and defeated them.

My favorite quote

"The three hardest tasks in the world are neither physical feats nor intellectual achievements, but moral acts: to return love for hate, to include the excluded, and to say, "I was wrong."

Sydney J. Harris

How to crack the SCDJWS ?..

The wikipedia says SCDJWS is the toughest and the most respected Sun Certification.
http://en.wikipedia.org/wiki/Sun_Certified_Professional#Sun_Certified_Developer_for_Java_Web_Services_.28SCDJWS.29
Very true indeed.

I scored 79% (55/69). Here's the split up.

XML Web Service Standards 80%
SOAP 1.1 Web Service Standards 83%
Describing and Publishing (WSDL and UDDI) 100%
JAX-RPC 85%
SOAP and XML Processing APIs (JAXP, JAXB and SAAJ) 100%
JAXR 75%
J2EE Web Services 71%
Security 75%
Developing Web Services 66%
General Design and Architecture 50%
Endpoint Design and Architecture 80%

Preparation Plan

1. RMH Book for XML Basics, Namespaces, Schemas, SOAP, WSDL
2. Rest of the chapters - MZ notes. - javaboot
3. xyzws.com mock exams

The questions in the real exam were little tough than xyzws mocks. It wasn't that straight forward, but with little thinking it can be answered.

I did practise a little with all the APIs. I hosted a Web Service using JAX-RPC, wrote some schemas and compiled it. I used the tomcat for java web services developer pack.

CSV Parser in Java

public class CSVParser {

public static final String CSV_REGEX_PATTERN = "\"([^\"]+?)\",?([^,]+),?,";
public static final String TSV_REGEX_PATTERN = "\t{1}";
public static Pattern csvRE;
public static Pattern tsvRE;

static {
csvRE = Pattern.compile(CSV_REGEX_PATTERN);
tsvRE = Pattern.compile(TSV_REGEX_PATTERN);
}

private List parse(String line) {

List list = new ArrayList();
Matcher m = csvRE.matcher(line);

// For each field
while (m.find()) {
String match = m.group();
if (match == null)
break;
//this will remove trailing , - comment this out if we dont want that affect
if (match.endsWith(",")) {
match = match.substring(0, match.length() - 1);
}
if (match.startsWith("\"")) {
match = match.substring(1, match.length () - 1);
}
if (match.length() == 0)
match = null;
list.add(match);
}

return list;
}

}

How to configure JMeter for your Web Application ?..

How to start ?..
From intranet network, we need to pass through the proxy, and here is the command to start JMeter via proxy.
Please navigate to the bin of the JMeter root directory and fire the following command
C:\project\jakarta-jmeter-2.2\jakarta-jmeter-2.2\bin>jmeter -H proxy.network.net -P 8080 -u -a
Create a Test Plan
1. The JMeter's left side pane contains a Test Plan and WorkBench Item.
2. Click on Test Plan Item.
3. Type in an appropriate name in the Test Plan name text box.
Add a Thread Group
1. Right click on the Test Plan Item
2. Naviagate to Add menu item.
3. Click on Thread Group
4. Name the thread group appropriately.
5. Enter the number of threads (users), ramp up count and loop count appropriately.
Add a Http Request Defaults
1. Right click on the Thread Group which has been created.
2. Naviagate to Add menu item.
3. Navigate to Config Element menu item.
4. Click on Http Request Defaults
Configure Http Request Defaults
1. Click on Http Request Defaults which has been newly created.
2. Enter the following details.
Name: give one
Server Name or IP: stage.com
Port Number:
Protocol: https
Path: /

Add Http Cookie Manager
1. Right click on the Thread Group which has been created.
2. Naviagate to Add menu item.
3. Navigate to Config Element menu item.
4. Click on Http Cookie Manager
Why do we need this ? - to be updated later
Add a Http Request
1. Right click on the Thread Group which has been created.
2. Naviagate to Add menu item.
3. Navigate to Sampler menu item.
4. Click on Http Request
Configure Http Request
1. Click on the Http Request item which has been created.
2. Enter the following details.
Name: Login
Method: Choose POST
Path: /security.AuthenticationServlet.serv
Follow Redirects: Check it.
3. Click on the Add button, to add request parameters.
Name Value Encode Include Equals
j_username hello_bosss no yes
j_password password yes yes
Add Results
1. Right click on the Thread Group which has been created.
2. Naviagate to Add menu item.
3. Navigate to Listener menu item.
4. Click on View Results Tree
Configure SSL Manager
1. Download the digital certificate.
2. Goto STAGE URL from the browser window.
3 Click on View button, when the security window pops up.
4. Goto Details tab
5. Click on Copy to File .. button.
6. Save the file to disk.
7. Navigate Options Menu in JMeter dialog screen.
8. Click on SSL Manager.
9. Enter the digital certificate file name with the path in the File Name: text box.
10. Click Open button.
11. Click Ok/Cancel if ask for a KeyStore password. The default password is 'changeit'
Run Test
1. Navigate to Run menu.
2. Click on the Start menu item.
3. Click on the View Results Tree which you created to see the results.

The Three Trees

Once there were 3 trees on a hill in the woods.
They were discussing their hopes and dreams when the first tree said, "Someday I hope to be a treasure chest. I could be filled with gold, silver and precious gems. I could be decorated with intricate carving and everyone would see the beauty."
Then the second tree said, "Someday I will be a mighty ship. I will take kings and queens across the waters and sail to the corners of the world. Everyone will feel safe in me because of the strength of my hull."
Finally the third tree said, "I want to grow to be the tallest and straightest tree in the forest. People will see me on top of the hill and look up to my branches, and think of the heavens and God and how close to them I am reaching. I will be the greatest tree of all time and people will always remember me."
After a few years of praying that their dreams would come true, a group of woodsmen came up on the trees. When one came to the first tree he said, "This looks like a strong tree, I think I should be able to sell the wood to a carpenter," and he began cutting it down. The tree was happy, because he knew that the carpenter would make him into a treasure chest.
At the second tree the woodsman said, "This looks like a strong tree, I should be able to sell it to the shipyard!" The second tree was happy because he knew he was on his way to becoming a mighty ship.
When the woodsmen came upon the third tree, the tree was frightened because he knew that if they cut him down his dreams would not come true. One of the woodsmen said, "I don't need anything special from my tree, I'll take this one," and he cut it down.
When the first tree arrived at the carpenters, he was made into a feed box for animals. He was then placed ! in a barn and filled with hay. This was not at all what he had prayed for.
The second tree was cut and made into a small fishing boat. His dreams of being a mighty ship and carrying kings had come to an end.
The third tree was cut into large pieces and left alone in the dark.
The years went by, and the trees forgot about their dreams. Then one day, a man and woman came to the barn. She gave birth and they placed the baby in the hay in the feed box that was made from the first tree. The man wished that he could have made a crib for the baby, but this manger would have to do. The tree could feel the importance of this event and knew that it had held the greatest treasure of all time.
Years later, a group of men got in the fishing boat made from the second tree. One of them was tired and went to sleep. While they were out on the water, a great storm arose and the tree didn't think it was strong enough to keep the men safe. The me! n woke the sleeping man, and He stood and said "PEACE" and the storm stopped. At this time, the tree knew that it had carried the King of Kings in its boat.
Finally, someone came and got the third tree. It was carried through the streets as the people mocked the man who was carrying it. When they came to a stop, the man was nailed to the tree and raised in the air to die at the top of a hill. When Sunday came, the tree came to realize that it was strong enough to stand at the top of the hill and be as close to God as was possible, because Jesus had been crucified on it.
The moral of this story is that when things don't seem to be going your way, always know that God has a plan for you. If you place your trust in Him, He will give you great gifts. Each of the trees got what they wanted, just not in the way they had imagined. We don't always know what God's plans are for us. We just know that His ways are not our ways, but His ways are always best.
Please keep this moving...pass it on, so He may inspire more people on the way. May your days be blessed. And until we meet again, may God cradle you in the palm of His hand
Always believe in God's works is wonderful.

-- unknown author