Feeds:
Posts
Comments

Archive for April, 2010

The ‘A’ Developer

Being an ‘A’ Developer is not easy: you should work hard, and read, and learn from your mistakes.

I tried to summarize my convictions about who ‘qualifies’ as an ‘A’ Developer, below:

1) ‘A’ Developer writes her/his code with a lot of enjoyment and enthusiasm.

2) ‘A’ Developer is not a coder; ‘A’ Developer is an ENGINEER.

3) ‘A’ Developer is always asking “Why” before starting to learn a new technology. For example, “Why Spring?”, “Why JPA?”, “Why JSF?”

4) ‘A’ Developer is Big Picture oriented, not details oriented.

5) ‘A’ Developer believes that Design Patterns are a MUST.

6) ‘A’ Developer should be involved in all tiers.

7)  ‘A’ Developer is a good starter and a good finisher as well.

8)  ‘A’ Developer has v.good communication skills.

9)  ‘A’ Developer does not depend on “Hello World” examples when trying to learn and master a new technology .

10) ‘A’ Developer is always updating him/herself with the latest market news and reads developers articles and comments.

11)  ‘A’ Developer is not a fantasist in terms of the latest framework or technology.

12)  ‘A’ Developer is a very good user to his IDE. He/she knows the most important options and shortcuts the IDE has.

13)  ‘A’ Developer hates the systematic route and always asks: “How I can automate this.”

14) ‘A’ Developer tends to keep things simple.

15) ‘A’ Developer is a reliable, committed, and hard worker.

16) ‘A’ Developer likes new challenges.

17) ‘A’ Developer understands the business before beginning to code.

18)  ‘A’ Developer looks for the best practice for everything he/she works on.

Am I right… what do you think…?!

Advertisements

Read Full Post »

Hi all,

I’d like to share with u the solution for Arabic in PDF Jasper Reports Problem.. Simply all what u need to do is to use a suitable font for arabic text and make it embedded in ur PDF.

Note :- Arial is highly recommended for Arabic.. so we will use it here.

1) Download Arial.TTF…

2) Put Arial.TTF in ur classpath.

3)Open ur *.jrxml file and replace all <font> tags with this:

<font fontName=”Arial” pdfFontName=”ARIAL.TTF” size=”22″ isPdfEmbedded =”true” pdfEncoding =”Identity-H”/>

u can change size, but other attributes DON’T TOUCH PLEASE.

Hopefully This will help anyone facing such problem.

Read Full Post »

After we explained how we can implement a JAX-WS web service (endpoint, client) in the JAX-WS Five Minute Tutorial, we will continue by explaining how we can deploy the web service endpoint on any application server… and here we’ll use Tomcat.

To deploy your WS endpoint you need to package it as a war first then deploy it on your application server.

Note:- You can download the source code from here this example from here.

Ok, lets begin

1) Open Eclipse.

2) Create a new Web project .

3) Create your Web Service interface (Greeting):

package juma.mohammad;

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService
public interface Greeting {
 @WebMethod String sayHello(String name);
}

4) Create your Web Service implementation (GreetingImpl):

package juma.mohammad;

import javax.jws.WebService;

@WebService(endpointInterface = "juma.mohammad.Greeting")
public class GreetingImpl implements Greeting {

 @Override
 public String sayHello(String name) {
 return "Hello, Welcom to jax-ws " + name;
 }

}

5) Now , you need generate Web Services classes, open your command line, and type :

cd %project_home%
wsgen -s src -d build/classes -cp build/classes juma.mohammad.GreetingImpl

Good , now you have two classe(SayHello.java, SayHelloResponse.java) generated under /greetingWS/src/juma/mohammad/jaxws .
6) Now we need to write our web.xml and put it under greetingWS/WebContent/WEB-INF

<?xml version="1.0" encoding="UTF-8"?>
<web-app
 xmlns="http://java.sun.com/xml/ns/j2ee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
 version="2.4">
 <listener>
 <listener-class>
 com.sun.xml.ws.transport.http.servlet.WSServletContextListener
 </listener-class>
 </listener>
 <servlet>
 <servlet-name>GreetingWS</servlet-name>
 <servlet-class>
 com.sun.xml.ws.transport.http.servlet.WSServlet
 </servlet-class>

 </servlet>
 <servlet-mapping>
 <servlet-name>GreetingWS</servlet-name>
 <url-pattern>/greeting</url-pattern>
 </servlet-mapping>
</web-app>


Note that in this web.xml we just defined two things : 1) listener-class 2)servlet !

7) ok,the final step is that you need to add sun-jaxws.xml under /greetingWS/WebContent/WEB-INF which contains endpoints definition:

<?xml version="1.0" encoding="UTF-8"?>
<endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" version="2.0">
 <endpoint
 name="GreetingWS"
 implementation="juma.mohammad.GreetingImpl"
 url-pattern="/greeting"/>
</endpoints>


8) You need to download JAX-WS library and put jars under /greetingWS/WebContent/WEB-INF/lib.

You can get jars from the attached sample 🙂

9) Great, now you just need to export this project as a war, and drop it under your Tomcat webapps folder .

10) Run Tomcat.

11) Try this url: http://localhost:8080/greetingWS/greeting

Congratulations… web service information page appeared 🙂

Read Full Post »

This tutorial is for people who want to run a JAX-WS example (Endpoint + Client) in just five minutes.

What you need to run this example:

  1. JDK 1.6
  2. Eclipse .
  3. Be Excited 😉

Note:- You can download the source code for this example from the resources section.

Developing WebService End Point

1) Open Eclipse, and create a java project “WS-Server”.

2) Create WS-Service Endpoint Interface:

package juma.mohammad;

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService
public interface Greeting {
	 @WebMethod String sayHello(String name);
}

3) Create WS-Service Endpoint Implementation class:

package juma.mohammad;

import javax.jws.WebService;

@WebService(endpointInterface = "juma.mohammad.Greeting")
public class GreetingImpl implements Greeting {

	@Override
	public String sayHello(String name) {
		return "Hello, Welcom to jax-ws " + name;
	}

}

4) Create Endpoint Publisher class:

package juma;

import javax.xml.ws.Endpoint;

import juma.mohammad.GreetingImpl;

public class WSPublisher {
	public static void main(String[] args) {
		Endpoint.publish("http://localhost:8080/WS/Greeting",new GreetingImpl());
	}
}

5) Run the WSPublisher…. Guess what .. your WebService is published..
Wow.. check your service wsdl http://localhost:8080/WS/Greeting?wsdl

Developing WebService Client :

1) Open eclipse and create a new java project WS-Client

2) As you know we need to generate the client stubs… but how?

open your command line, and enter the wsimport command:

CD %CLIENT_PROJECT_HOME%\src
wsimport –s . http://localhost:8080/WS/Greeting?wsdl

You will find 6 java classes generated, and compiled under src/juma/mohammad.

You can remove *.class files , no need for them 🙂

3) Now Lets create Client Class which will be dependent on the stubs:

package juma;

import juma.mohammad.Greeting;
import juma.mohammad.GreetingImplService;

public class Client {
	public static void main(String[] args){

GreetingImplService service = new GreetingImplService();
Greeting greeting = service.getGreetingImplPort();
System.out.println("------->>  Call Started");
System.out.println(greeting.sayHello("Ali"));
System.out.println("------->>  Call Ended");
	}
}

4) Run the Client Class…. the output should looks like:

------->>  Call Started
Hello, Welcom to jax-ws Ali
------->>  Call Ended

Congratulations…. you managed to develop jax-ws Endpoint , Client..

The next tutorial will be how to deploy your Web Service on Tomcat.

Read Full Post »