• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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());
}
}
}
 
Let nothing stop you! Not even this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic