aspose file tools*
The moose likes Web Services and the fly likes Soap client giving error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Soap client giving error" Watch "Soap client giving error" New topic
Author

Soap client giving error

Aastha Surya
Greenhorn

Joined: Sep 15, 2005
Posts: 7
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 ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
You're missing commons-logging-1.0.4.jar, which comes with the Axis distribution, in your classpath.


Ping & DNS - my free Android networking tools app
S Chandani
Greenhorn

Joined: Oct 04, 2005
Posts: 1
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());
}
}
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Soap client giving error