• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Soap client giving error

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All!!

I am trying out a webservice in Axis..
I refered the javaworld's
"Axis: The next generation of Apache SOAP " tutorial.

I tried a simple "HelloServer" program as webservice..
According to the doc.. when I tried to compile the client..which used org.apache.axis.client.ServiceClient;
package.. it failed as the axis.jar didnot has this class.. I tried to download varios axis.jar but it didn't work..

I tried another client program pasted below.
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;
import org.w3c.dom.*;
import javax.xml.rpc.ParameterMode;
import java.util.*;

public class Client1
{
public static void main(String[] args) throws Exception
{
try{
String endpoint = "http://localhost:8080/axis/HelloServer.jws";

Service service = new Service();
Call call = (Call) service.createCall();

call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName( "sayHelloTo" );

call.addParameter("szProduct",XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);

call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);



String ret = (String)call.invoke( new Object [] { args[0] });

System.out.println(ret);
}catch(Exception e){System.out.println("Exception...::"+e.toString());}
}
}

It compiled and when I started running it I got the following exception

Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.commons.logging.LogFactory

My classpath includes all axis.jar,jaxrpc and log4j-core.jar..

can anyone plz help me to figureout where exactly I am going wrong?

Also is there any good document which expalins how to deploy a web application in websphere?

Thanks
Aastha
[ September 23, 2005: Message edited by: Aastha Surya ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're missing commons-logging-1.0.4.jar, which comes with the Axis distribution, in your classpath.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this code instead:

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
public class AxisClient3 {

public static void main(String[] args) {
try {
String endpoint = "http://localhost:8080/axis/HelloServer.jws";
Service service = new Service();
Call call = (Call) service.createCall();

call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName(new QName("http://soapinterop.org/", "sayHelloTo"));
String ret = (String) call.invoke(new Object[] { "schandani" });

System.out.println("Sent 'schandani', got '" + ret + "'");
} catch (Exception e) {
System.err.println(e.toString());
}
}
}
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic