Hi Robert,
Thanks for suggestion.
Now its running. But not processing correctly.
Please see the code snap below:
EndpointReference targetEPR = new
EndpointReference("http://192.168.1.139:8080/axis2/services/WeatherService")
; // service is runnig well and producing wsdl.
options.setTo(targetEPR);
// Setting the weather
QName opSetWeather = new QName("http://service.pojo.sample/xsd",
"setWeather");
Weather w = new Weather();
w.setTemperature((float)39.3);
w.setForecast("Cloudy with showers");
w.setRain(true);
w.setHowMuchRain((float)4.5);
Object[] opSetWeatherArgs = new Object[] { w };
serviceClient.invokeRobust(opSetWeather, opSetWeatherArgs);
// Getting the weather
QName opGetWeather =
new QName("http://service.pojo.sample/xsd", "getWeather");
Object[] opGetWeatherArgs = new Object[] { };
Class[] returnTypes = new Class[] { Weather.class };
Object[] response = serviceClient.invokeBlocking(opGetWeather,
opGetWeatherArgs, returnTypes);
Weather result = (Weather) response[0];
if (result == null) {
System.out.println("Weather didn't initialize!"); // I am
getting this message means result object is not initialized.
return;
}
// Displaying the result
System.out.println("Temperature : " +
result.getTemperature());
System.out.println("Forecast : " +
result.getForecast());
System.out.println("Rain : " +
result.getRain());
System.out.println("How much rain (in inches) : " +
result.getHowMuchRain());
Thanks in advance..
-R
_____
From: robert lazarski [mailto:[email protected]]
Sent: Friday, April 24, 2009 8:02 PM
To: [email protected]
Subject: Re: [axis2] | Problem running axis2 client
On Fri, Apr 24, 2009 at 11:30 AM, Rajneesh Kumar
<[email protected]> wrote:
Hi All,
I have created and deployed a web service on axis2. Now I start to work for
client as it is given on apache axis2 site. After some effort the client
gets compiled. But I am not able to run it because it needs many approx 56
jar file at run time as apache suggest. I have tried to set all in
environment variable "CLASSPATH" but it does not accept so many file names.
Then I tried to set class path using a batch file technique also tried to
set it on command prompt directly but in each case failed and the client app
produce error on console:
The stack trace is given below:
C:\ axiswebservice\WeatherClient>java WeatherRPCClient
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/axiom/om/OMNode
Use ant to execute your client, since you can list a directory with all your
JAR's and ant will take care of everything for you.
- R
===================================================================================================
Private, Confidential and Privileged. This e-mail and any files and attachments
transmitted with it are confidential and/or privileged. They are intended
solely for the use of the intended recipient. The content of this e-mail and
any file or attachment transmitted with it may have been changed or altered
without the consent of the author. If you are not the intended recipient,
please note that any review, dissemination, disclosure, alteration, printing,
circulation or Transmission of this e-mail and/or any file or attachment
transmitted with it, is prohibited and may be unlawful. If you have received
this e-mail or any file or attachment transmitted with it in error please
notify OTS Solutions at [email protected]
===================================================================================================