Hi Vivek. First of all, I don't think your request needs to be
exactly as you say it should be.

That doesn't sound right. I can only suggest that you use NetBeans/GlassFish to generate the client code, and start with a tutorial. This is not trivial code. Beyond a certain point, it is very difficult to help. Here are some links to get you started:
-
http://netbeans.dzone.com/news/5-techniques-create-web-servic
-
http://qa.netbeans.org/modules/j2ee/promo-g/end2end/numbers.html
I suggest that you download and use the above (if it is new to you, then again, there will be a learning curve), point to your wsdl, let it generate the request and use it.
Anyway, I am sorry to say that I am unable to find a clean solution to this. I don't know how to do it in old Axis 1.4 ... However, I used Java 1.6 (but 1.5 should also work) and Axis2 1.5.1. Here is what I did:
open command prompt
mkdir
test (test directory that we can delete once we are done)
cd test
set axis2_home=C:\axis2-1.5.1\
set path=%axis2_home%\bin;%path%
mkdir gen (to hold the generated code)
- Look at the wsdl2java options. You may find some of them useful
wsdl2java -o gen -p mypkg -uri
http://localhost:8080/HelloWs/GreeterWs?wsdl
wsdl2java -o gen -p mypkg -uri <WSDL URL>
My web service is called GreeterWs. So this generates two classes: GreeterWsStub.java and GreeterWsCallbackHandler.java
create a new Java project in Eclipse
copy over the generated code under gen/src to the source directory in Eclipse project
add the following jars to the build path: axiom-api*.jar, axiom-impl*.jar, axis2-adb*.jar, axis2-kernel*.jar, wsdl4j*.jar, XmlSchema*.jar, neethi*.jar, axis2-transport-local*.jar, axis2-transport-http*.jar, commons-httpclient*.jar, mail*.jar, httpcore*.jar, commons-codec*.jar
actually just add all the jars in the Axis2 lib directory
Search the generated Stub code for "toEnvelope" to see how the envelope is created
To add a namespace to the envelope, please look at
this:
Search for "_messageContext.setEnvelope(env);" in the stub code, and then add these lines before the envelope is set:
To add custom headers, see
this.
Write a simple test client. Here is the one that worked for me, so your code will look something like this: