• 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

javax/xml/soap/SOAPException in EJB3 Web Service

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Praveena Chordia
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
reply
    Bookmark Topic Watch Topic
  • New Topic