Texantek » Core Java

creating a weather webservice client  XML

Author Message

Joined: 16/02/2012 12:59:39
Messages: 23

This tutorial explains the process of creating the webservice client for a weather application. I am using axis 2 for this purpose and soap UI for testing the web services. please put all the library files from axis into the lib folder of your project and add it to the build path. I am using Eclispe IDE for this purpose.
I am using the following uri for the WSDL file I found on the internet:http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl to generate the java stub files. To generate the stub files go to you command prompt and go to your axis 2.0 bin folder in my case it is :C:\Users\sagar\Desktop\JAVA Training\axis2-1.6.1-bin\axis2-1.6.1\bin. you need to run the wsdl2java.bat file to generate the java files from the wsdl file .use this command to generate the java class file :

This will create two java class file into the weather folder inside the bin directory of your axis 2.
Now create a package called "com.cdyne.ws.weatherws" inside the src folder of your project folder and copy these two java files inside the package.
Now we will create a .JAR file out of these java classes and add it into the lib folder of our project. select these two java class files right click and export jar and name it as anything , in my case i named it as "weather.jar"
Now copy the jar file into the lib folder of your project and and add it to the build path too.
Now we will be using the jar file to access the web services methods and you can delete the two java classes files we copied as they already are in the jar files.
.I am writing a test program to test my web service now. I will write a "WeatherTest.java" file to test it.before writing it you can find out what the wsdl file is taking as request and what response it is giving back by simply copying the wsdl link"http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl" into the SoapUI software.After i found out my requests and response i wrote my test program as follows:

Now you are all set. Run your program and enjoy your weather. the output i got is :

Send a PM

Joined: 30/01/2018 01:10:31
Messages: 7

adidas Crazy Explosive 2017
adidas Dame 4
KD 9
KD Shoes
KD 9 Shoes
KD 9 Elite
Nike Kyrie 3
Kevin Durant Shoes
Nike Kyrie S1 Hybrid
Kyrie 4 Shoes
Kyrie 3 Samurai
Kyrie 3 BHM
Kyrie 2
Kyrie 4
Kyrie Shoes
kyrie irving shoes
Kyrie 3
Kyrie 3 Shoes
Lebron 14
Lebron Shoes
Lebron 14 Low
Lebron 14 Shoes
LeBron Ambassador 9
LeBron Soldier 10
Basketball Shoes
NBA Store
NBA Stars Shoes
Curry Shoes
NBA Shoes
Kyrie Shoes
Curry 1
Curry 2
Nike Flyknit
Nike Flyknit Racer
Nike Roshe Flyknit
Nike Free Flyknit
Nike Outlet
Nike Store
Nike Outlet Store
Nike Factory Store
Jordan Shoes
Cheap Jordans
Nike Air Max
New Nike Shoes 2017
Cheap Yeezys
New Yeezy Boost
Yeezy Boost 500
Yeezy 700
Adidas Yeezy Powerphase
Kids Yeezy Shoes
Adidas Yeezy Boost 350
Adidas Yeezy Boost 350 V2
Yeezy Boost 350 V2
Yeezy Boost 350
Yeezy Desert Rat 500
Yeezy Wave Runner 700
Yeezy Powerphase Calabasas
Yeezy Boost 350 V2 Kids
Nmd R1
Nmd R2
Nmd Xr1
Addidas Nmd
Human Race Nmd
Yeezy 500
Adidas Shoes 2018
Cheap Adidas Shoes
Adidas NMD R1
Adidas NMD R2
Harden Vol. 1
Harden Vol. 2
Adidas Yeezy Boost
Adidas NMD Human Race
Adidas Ultra Boost 4.0
Adidas Ultra Boost 3.0
NBA Jerseys
Cheap NBA Jerseys
Cheap Ray Bans
Ray Ban Sale
Ray Bans On Sale
Ray Ban Sunglasses Sale
Ray Ban Wholesale
Cheap Ray Ban Sunglasses Sale
Ray Ban Sunglasses Outlet
Ray Ban Sunglasses Cheap
Coach Outlet
Coach Outlet Online
Coach Handbags
Coach Purses
Coach Factory Outlet
Coach Factory
Coach Outlet Store Online
Coach Factory Store
Coach Bags Clearance
Coach Bags Outlet
Coach Purses On Sale
Coach Purses Cheap
Longchamp Bag
Longchamp Sale
Longchamp Bags
Longchamp Backpack
Longchamp Outlet
Longchamp Purses
Longchamp Bag Sale
Longchamp Le Pliage
Longchamp Bags Outlet
Michael Kors Outlet
Michael Kors Sale
Michael Kors Outlet Online
Michael Kors Outlet Online Sale
Michael Kors
Michael Kors Handbags
Michael Kors Purses
Michael Kors Bags
Nike Free Run
Nike Free 5.0
Nike Free
Nike Store
Nike Free 4.0
Nike Free 3.0
Air Max 1 Ultra Moire
Kobe 12
Kobe AD
Kobe Shoes
Kobe bryant Shoes
Kobe 11 Shoes
Kobe 11
Kobe 11 Elite
Kobe Shoes
Cheap Jordans for Sale
Cheap Jordans
Jordans for Sale
Cheap Jordan Shoes
Jordans Shoes 2018
New Jordans 2018
Jordan Shoes For Sale
Jordan Shoes
Red Bottom Shoes For Women
Red Bottom Shoes
Red Sole Shoes Christian Louboutin
Red Bottoms Shoes On Sale
Red Bottom Shoes Christian Louboutin
Christian Louboutin
Christian Louboutin Shoes on Sale
Christian Louboutin Sale
Christian Louboutin Shoes
Christian Louboutin Outlet
Nike Air Max
Nike VaporMax
Nike VaporMax Flyknit
Nike Air Max 2017
Nike Air Max 2016
Nike Air Max 2018
Air Max 95
Air Max 90
Nike Air Max Tavas
Nike Air Max Zero
Special Field Air Force 1s
Nike Shoes 2017
Kobe AD
Kobe Shoes
Kobe AD Shoes
Nike Kobe AD
Kobe A.D.
Kobe A.D. Shoes
Eqt Adidas
Adidas Eqt
Adidas Eqt Support
Adidas Eqt Adv
Adidas Eqt Support Adv
Adidas EQT Support 91/16
James Harden Shoes
Harden Shoes
Harden Vol 1
Harden Vol 2
Harden Vol 1 Shoes
Adidas Crazylight Boost
Send a PM
Texantek » Core Java
Go to:   
Powered by JForum © Texantek