aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes javax/xml/soap/SOAPException in EJB3 Web Service 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 » EJB and other Java EE Technologies
Bookmark "javax/xml/soap/SOAPException in EJB3 Web Service" Watch "javax/xml/soap/SOAPException in EJB3 Web Service" New topic
Author

javax/xml/soap/SOAPException in EJB3 Web Service

Praveena Chordia
Ranch Hand

Joined: Jun 08, 2007
Posts: 33
I am implementing EJB3 web service .
IDE is eclipse
Application Server is JBoss

Server side is doing properly ,when I am running my following client

public class Client {
public static void main(String[] args) throws Exception {
System.out.println("Starting Test Client");
URL url = new URL(
"http://localhost:8080/imaging/ImagingServiceBean?wsdl");
QName qname = new QName("http://ejb.iba.by/jaws",
"ImagingServiceService");

System.out.println("Creating a service Using: \n\t" + url + " \n\tand "
+ qname);
ServiceFactory factory = ServiceFactory.newInstance();
Service remote = factory.createService(url, qname);

System.out.println("Obtaining reference to a proxy object");
ImagingService proxy = (ImagingService) remote
.getPort(ImagingService.class);
System.out.println("Accessed local proxy: " + proxy);

String string = "John";
System.out.println("Sending: " + string);

System.out.println("Receiving: " + proxy.echo("John"));
}
}



in the statement Service remote = factory.createService(url, qname);

i am getting follwing exception.........

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException
at org.apache.axis.encoding.DefaultTypeMappingImpl.<init>(DefaultTypeMappingImpl.java:153)
at org.apache.axis.encoding.DefaultTypeMappingImpl.<init>(DefaultTypeMappingImpl.java:130)
at org.apache.axis.encoding.DefaultTypeMappingImpl.getSingleton(DefaultTypeMappingImpl.java:124)
at org.apache.axis.encoding.TypeMappingRegistryImpl.<init>(TypeMappingRegistryImpl.java:180)
at org.apache.axis.deployment.wsdd.WSDDDeployment.<init>(WSDDDeployment.java:510)
at org.apache.axis.deployment.wsdd.WSDDDocument.<init>(WSDDDocument.java:104)
at org.apache.axis.configuration.FileProvider.configureEngine(FileProvider.java:209)
at org.apache.axis.AxisEngine.init(AxisEngine.java:188)
at org.apache.axis.AxisEngine.<init>(AxisEngine.java:173)
at org.apache.axis.client.AxisClient.<init>(AxisClient.java:88)
at org.apache.axis.client.Service.getAxisClient(Service.java:145)
at org.apache.axis.client.Service.<init>(Service.java:187)
at org.apache.axis.client.ServiceFactory.createService(ServiceFactory.java:233)
at by.iba.client.Client.main(Client.java:22)

I have added all jars from my end..if something missing in my classpath then please help me in that which jar I have to add in my classpath
Praveena Chordia
Ranch Hand

Joined: Jun 08, 2007
Posts: 33
I have added all needed jars in the classpath
set JBOSS_HOME=C:\jboss-4.0.5.GA

set CLASSPATH=..\build\classes
set CLASSPATH=%CLASSPATH%;%JBOSS_HOME%\client\jboss-saaj.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_HOME%\client\jboss-ejb3-client.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_HOME%\client\jboss-xml-binding.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_HOME%\client\jboss-jaxrpc.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_HOME%\client\jbossws-client.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_HOME%\client\activation.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_HOME%\client\mail.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_HOME%\client\wsdl4j.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_HOME%\lib\endorsed\xercesImpl.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_HOME%\client\jbossall-client.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_HOME%\server\default\lib\jboss-remoting.jar

and now I am getting other exception at the following staement

ImagingService proxy = (ImagingService) remote
.getPort(ImagingService.class);

Starting Test Client
Creating a service Using:
http://localhost:8080/imaging/ImagingServiceBean?wsdl
and {http://ejb.iba.by/jaws}ImagingServiceService
Obtaining reference to a proxy object
Exception in thread "main" java.lang.UnsupportedOperationException: Cannot find operation: toString - none defined
at org.apache.axis.client.Call.setOperation(Call.java:1252)
at org.apache.axis.client.AxisClientProxy.invoke(AxisClientProxy.java:187)
at $Proxy0.toString(Unknown Source)
at java.lang.String.valueOf(String.java:2615)
at java.lang.StringBuilder.append(StringBuilder.java:116)
at by.iba.client.Client.main(Client.java:27)

please help me in this
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10202
    
166

Exception in thread "main" java.lang.UnsupportedOperationException: Cannot find operation: toString - none defined
at org.apache.axis.client.Call.setOperation(Call.java:1252)
at org.apache.axis.client.AxisClientProxy.invoke(AxisClientProxy.java:187)
at $Proxy0.toString(Unknown Source)



System.out.println("Receiving: " + proxy.echo("John"));


What does proxy.echo return? Please post the code of ImagingService.


[My Blog] [JavaRanch Journal]
Praveena Chordia
Ranch Hand

Joined: Jun 08, 2007
Posts: 33
Code of ImagingService

package by.iba.ejb;

import java.util.Map;

import javax.ejb.Remote;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;


@WebService
@Remote
@SOAPBinding(style = Style.RPC)

public interface ImagingService extends java.rmi.Remote {
@WebMethod
public Object doCall(Map aRequest)throws java.rmi.RemoteException;
public String echo(String e);

}

now at
ImagingService proxy = (ImagingService) remote
.getPort(ImagingService.class);
my client is throwing following exception

Exception in thread "main" javax.xml.rpc.JAXRPCException: Cannot find operation: toString - none defined
at org.apache.axis.client.Call.setOperation(Call.java:1253)
at org.apache.axis.client.AxisClientProxy.invoke(AxisClientProxy.java:184)
at $Proxy0.toString(Unknown Source)
at java.lang.String.valueOf(String.java:2615)
at java.lang.StringBuilder.append(StringBuilder.java:116)
at by.iba.client.Client.main(Client.java:27)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javax/xml/soap/SOAPException in EJB3 Web Service