CastCallException

2005-05-06 Thread Bruno Gonçalves





Hi there!

I found the reason for the
CastClassException in my webapp.
I'm using JAAS in my webapp, and I
must deploy (with ant) it for using
in my webapp, and is in there that a call to a webservice is done. It
seems that the call by this way generate a ClassCastException :(
Instead, If I call a webservice
outside of that JAAS deploy, there is
no problem!

If anybody know's the reason, please
tell me.

Thanks one more time!

---
Bruno Vg







axis client on a web application on tomcat

2005-05-04 Thread Bruno Gonçalves





Hi there!

Anyone can tell me an example, or
send me any code that shows a axis
client runing on a webapp on tomcat (say it 5.0.28) connecting to a web
service?
I can't put any example runing :(
I've tried install a fresh tomcat
but I got allways the same exception:
ClassCastException.

Please help.. :(

---
Bruno Vg







help with a ClassCastException

2005-04-28 Thread Bruno Gonçalves




Hi everyone!

Still have the same ClassCastException when I invoke a method on my
stub.

My code:
 public String Test(String str){
  
  try{
   EchoServiceLocator service = new EchoServiceLocator();
   Echo port = service.getEcho();
   return port.echoMethod(str); =
ClassCastException
  }catch (Exception e)
  {
   System.err.println(e.getMessage());
   logger.error("Could not connect to Web Service!",e);
   return null;
  }
 }

ERROR:
AxisFault
faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode: 
faultString: java.lang.ClassCastException
faultActor: 
faultNode: 
faultDetail: 
 {http://xml.apache.org/axis/}stackTrace:java.lang.ClassCastException
 at
org.apache.axis.deployment.wsdd.WSDDTargetedChain.makeNewInstance(WSDDTargetedChain.java:157)
 at
org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:274)
 at
org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
 at
org.apache.axis.deployment.wsdd.WSDDDeployment.getTransport(WSDDDeployment.java:441)
 at
org.apache.axis.configuration.FileProvider.getTransport(FileProvider.java:257)
 at org.apache.axis.AxisEngine.getTransport(AxisEngine.java:332)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:163)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2754)
 at org.apache.axis.client.Call.invoke(Call.java:2737)
 at org.apache.axis.client.Call.invoke(Call.java:2413)
 at org.apache.axis.client.Call.invoke(Call.java:2336)
 at org.apache.axis.client.Call.invoke(Call.java:1793)
 at
bvg.axis.services.Echo.EchoSoapBindingStub.echoMethod(EchoSoapBindingStub.java:102)
 at com.jcms.Axis.Webservices.Test(Webservices.java:61)
 at jaas.module.SampleLoginModule.login(SampleLoginModule.java:210)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at
javax.security.auth.login.LoginContext.invoke(LoginContext.java:675)
 at
javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
 at
javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
 at java.security.AccessController.doPrivileged(Native Method)
 at
javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
 at
javax.security.auth.login.LoginContext.login(LoginContext.java:534)
 at
org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:316)
 at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:229)
 at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
 at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
 at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
 at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
 at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
 at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
 at java.lang.Thread.run(Thread.java:534)

 {http://xml.apache.org/axis/}hostname:bvg

java.lang.ClassCastException
 at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:216)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2754)
 at org.apache.axis.client.Call.invoke(Call.java:2737)
 at org.apache.axis.client.Call.invoke(Call.java:2413)
 at org.apache.axis.client.Call.invoke(Call.java:2336)
 at org.apache.axis.client.Call.invoke(Call.java:1793)
 at
bvg.axis.services.Echo.EchoSoapBindingStub.echoMethod(EchoSoapBindingStub.java:102)
 at com.jcms.Axis.Webservices.Test(Webservices.java:61)
 at jaas.module.SampleLoginModule.login(SampleLoginModule.java:210)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at

Re: reply:help with a ClassCastException

2005-04-28 Thread Bruno Gonçalves




I already try that, but I get the same
ClassCastException.
I think that the problem is some type of conflict with the jars of
tomcat... I'm tired :(

Thanks anyway zhangyu :)

[EMAIL PROTECTED] wrote:

  Modified code: 
public String Test(String str){

try{
EchoServiceLocator service = new EchoServiceLocator();
Echo port = service.getEcho();
return (String)port.echoMethod(str); = You can change here!
}catch (Exception e)
{

System.err.println(e.getMessage());
logger.error("Could not connect to Web Service!",e);
return null;
}
}
  
  
  
  

  

Subject:

help with a ClassCastException
  
  

From: 
Bruno Gonlves [EMAIL PROTECTED]
  
  

Date: 
Thu, 28 Apr 2005 12:30:26 +0100
  
  

To: 
axis-user@ws.apache.org
  

  
  

  

To: 
axis-user@ws.apache.org
  

  
  
  
  Hi everyone!
  
Still have the same ClassCastException when I invoke a method on my
stub.
  
  My code:
   public String Test(String str){
  
  try{
   EchoServiceLocator service = new EchoServiceLocator();
   Echo port = service.getEcho();
   return port.echoMethod(str); =
ClassCastException
  }catch (Exception e)
  {
   System.err.println(e.getMessage());
   logger.error("Could not connect to Web Service!",e);
   return null;
  }
 }
  
  ERROR:
  AxisFault
faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode: 
faultString: java.lang.ClassCastException
faultActor: 
faultNode: 
faultDetail: 
 {http://xml.apache.org/axis/}stackTrace:java.lang.ClassCastException
 at
org.apache.axis.deployment.wsdd.WSDDTargetedChain.makeNewInstance(WSDDTargetedChain.java:157)
 at
org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:274)
 at
org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
 at
org.apache.axis.deployment.wsdd.WSDDDeployment.getTransport(WSDDDeployment.java:441)
 at
org.apache.axis.configuration.FileProvider.getTransport(FileProvider.java:257)
 at org.apache.axis.AxisEngine.getTransport(AxisEngine.java:332)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:163)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2754)
 at org.apache.axis.client.Call.invoke(Call.java:2737)
 at org.apache.axis.client.Call.invoke(Call.java:2413)
 at org.apache.axis.client.Call.invoke(Call.java:2336)
 at org.apache.axis.client.Call.invoke(Call.java:1793)
 at
bvg.axis.services.Echo.EchoSoapBindingStub.echoMethod(EchoSoapBindingStub.java:102)
 at com.jcms.Axis.Webservices.Test(Webservices.java:61)
 at jaas.module.SampleLoginModule.login(SampleLoginModule.java:210)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at
javax.security.auth.login.LoginContext.invoke(LoginContext.java:675)
 at
javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
 at
javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
 at java.security.AccessController.doPrivileged(Native Method)
 at
javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
 at
javax.security.auth.login.LoginContext.login(LoginContext.java:534)
 at
org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:316)
 at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:229)
 at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
 at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
 at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
 at

Re: exception when call.invoke

2005-04-27 Thread Bruno Gonçalves
Humm.. It seems that there are conflict with the libs of tomcat, can it 
be possible?
Because I can invoke the stubs without not using a webAplication in 
Tomcat, and they work!
Now, what's the problematic lib? :(

In my project lib I have this libs:
SampleAcn.jar
SampleLM.jar cid:[EMAIL PROTECTED]
WSEcho.jar cid:[EMAIL PROTECTED]
axis-ant.jar cid:[EMAIL PROTECTED]
axis.jar cid:[EMAIL PROTECTED]
commons-beanutils.jar cid:[EMAIL PROTECTED]
commons-collections.jar cid:[EMAIL PROTECTED]
commons-dbcp.jar cid:[EMAIL PROTECTED]
commons-digester.jar cid:[EMAIL PROTECTED]
commons-discovery.jar cid:[EMAIL PROTECTED]
commons-fileupload.jar cid:[EMAIL PROTECTED]
commons-lang.jar cid:[EMAIL PROTECTED]
commons-logging.jar cid:[EMAIL PROTECTED]
commons-pool.jar cid:[EMAIL PROTECTED]
commons-resources.jar cid:[EMAIL PROTECTED]
commons-validator.jar cid:[EMAIL PROTECTED]
jakarta-oro.jar cid:[EMAIL PROTECTED]
jaxrpc.jar cid:[EMAIL PROTECTED]
jdogenie.jar cid:[EMAIL PROTECTED]
jstl.jar cid:[EMAIL PROTECTED]
jta.jar cid:[EMAIL PROTECTED]
log4j-1.2.8.jar cid:[EMAIL PROTECTED]
msbase.jar cid:[EMAIL PROTECTED]
mssqlserver.jar cid:[EMAIL PROTECTED]
msutil.jar cid:[EMAIL PROTECTED]
openaccess.jar cid:[EMAIL PROTECTED]
saaj.jar cid:[EMAIL PROTECTED]
soap.jar cid:[EMAIL PROTECTED]
standard.jar cid:[EMAIL PROTECTED]
struts.jar cid:[EMAIL PROTECTED]
wsdl4j.jar cid:[EMAIL PROTECTED]
in Tomcat (5.0.28) libs:
ant-launcher.jar cid:[EMAIL PROTECTED]
ant.jar cid:[EMAIL PROTECTED]
commons-collections-3.1.jar cid:[EMAIL PROTECTED]
commons-dbcp-1.2.1.jar cid:[EMAIL PROTECTED]
commons-el.jar cid:[EMAIL PROTECTED]
commons-pool-1.2.jar cid:[EMAIL PROTECTED]
jasper-compiler.jar cid:[EMAIL PROTECTED]
jasper-runtime.jar cid:[EMAIL PROTECTED]
jsp-api.jar cid:[EMAIL PROTECTED]
naming-common.jar cid:[EMAIL PROTECTED]
naming-factory.jar cid:[EMAIL PROTECTED]
naming-java.jar cid:[EMAIL PROTECTED]
naming-resources.jar cid:[EMAIL PROTECTED]
servlet-api.jar cid:[EMAIL PROTECTED]
Any ideas?
Thanks one more time..
Bruno Gonçalves wrote:
Mr. Ragade, can you help me?
This is very strange, because nobody had the same problem!
I'm using Tomcat 5.0.28.
Thanks one more time!
Bruno Gonçalves wrote:
I already did that but I exactly have the same problem! :(
How it can be possible?
Thanks anyway!
[EMAIL PROTECTED] wrote:
What are you running this in ? In a standalone client or in an 
application server (which one?)
 
Why don't you try using wsdl2java and create stub classes to use 
instead. It is far simpler.
then your call to the web service just becomes:
ret = echoWebService.test(code,utilizador_portal,password);
 

-Original Message-
*From:* Bruno Gonçalves [mailto:[EMAIL PROTECTED]
*Sent:* Friday, April 15, 2005 5:37 AM
*To:* axis-user@ws.apache.org
*Subject:* exception when call.invoke
Hi there!
I receive this exception:
*/java.lang.ClassCastException:
org.apache.axis.transport.http.HTTPSender/*
,when I execute this code:
try {
String endpoint = http://localhost:8080/axis/Echo.jws;;
logger.info(DEBUG  1);
Service service = new Service();
logger.info(DEBUG  2);
Call call = (Call) service.createCall();
logger.info(DEBUG  3);
call.setTargetEndpointAddress( new
java.net.URL(endpoint) );
call.setOperation(test);
call.addParameter(code, XMLType.XSD_STRING,
ParameterMode.IN);
call.addParameter(utilizador_portal,
XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(password, XMLType.XSD_STRING,
ParameterMode.IN);
call.setReturnType(XMLType.XSD_STRING);
   
logger.info(DEBUG  4);
//call.setOperationName(new
QName(http://soapinterop.org/;, test));
//logger.info(DEBUG  5);

String ret = (String) call.invoke(new Object[]
{123, user, passwd}); = EXCEPTION!!
logger.info(DEBUG  6);
System.out.println(RESULT  ' + ret + ');
logger.info(DEBUG  7);
} catch (Exception e) {
System.err.println(e.toString());
}
Any help? :(
---
Bruno Vg





java.lang.NullPointerException

2005-04-27 Thread Bruno Gonçalves
I don't get no more CastClassException (I put the libs of Axis on the 
common/lib of tomcat), but instead I got a java.lang.NullPointerException :(
Here is the error:

java.lang.NullPointerException
   at 
org.apache.axis.client.Service.getEngineConfiguration(Service.java:803)
   at org.apache.axis.client.Service.getAxisClient(Service.java:104)
   at org.apache.axis.client.Service.init(Service.java:113)
   at 
bvg.axis.services.Echo.EchoServiceLocator.init(EchoServiceLocator.java:12)
   at com.jcms.Axis.Webservices.Test(Webservices.java:59)
   at jaas.module.SampleLoginModule.login(SampleLoginModule.java:210)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:324)
   at javax.security.auth.login.LoginContext.invoke(LoginContext.java:675)
   at 
javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
   at javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
   at java.security.AccessController.doPrivileged(Native Method)
   at 
javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
   at javax.security.auth.login.LoginContext.login(LoginContext.java:534)
   at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:316)
   at 
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:229)
   at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)
   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
   at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
   at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
   at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
   at 
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
   at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
   at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
   at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
   at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
   at java.lang.Thread.run(Thread.java:534)

Ideas?
Thanks people..
Bruno Gonçalves wrote:
Humm.. It seems that there are conflict with the libs of tomcat, can 
it be possible?
Because I can invoke the stubs without not using a webAplication in 
Tomcat, and they work!
Now, what's the problematic lib? :(

In my project lib I have this libs:
SampleAcn.jar
SampleLM.jar cid:[EMAIL PROTECTED]
WSEcho.jar cid:[EMAIL PROTECTED]
axis-ant.jar cid:[EMAIL PROTECTED]
axis.jar cid:[EMAIL PROTECTED]
commons-beanutils.jar cid:[EMAIL PROTECTED]
commons-collections.jar cid:[EMAIL PROTECTED]
commons-dbcp.jar cid:[EMAIL PROTECTED]
commons-digester.jar cid:[EMAIL PROTECTED]
commons-discovery.jar cid:[EMAIL PROTECTED]
commons-fileupload.jar cid:[EMAIL PROTECTED]
commons-lang.jar cid:[EMAIL PROTECTED]
commons-logging.jar cid:[EMAIL PROTECTED]
commons-pool.jar cid:[EMAIL PROTECTED]
commons-resources.jar cid:[EMAIL PROTECTED]
commons-validator.jar cid:[EMAIL PROTECTED]
jakarta-oro.jar cid:[EMAIL PROTECTED]
jaxrpc.jar cid:[EMAIL PROTECTED]
jdogenie.jar cid:[EMAIL PROTECTED]
jstl.jar cid:[EMAIL PROTECTED]
jta.jar cid:[EMAIL PROTECTED]
log4j-1.2.8.jar cid:[EMAIL PROTECTED]
msbase.jar cid:[EMAIL PROTECTED]
mssqlserver.jar cid:[EMAIL PROTECTED]
msutil.jar cid:[EMAIL PROTECTED]
openaccess.jar cid:[EMAIL PROTECTED]
saaj.jar cid:[EMAIL PROTECTED]
soap.jar cid:[EMAIL PROTECTED]
standard.jar cid:[EMAIL PROTECTED]
struts.jar cid:[EMAIL PROTECTED]
wsdl4j.jar cid:[EMAIL PROTECTED]
in Tomcat (5.0.28) libs:
ant-launcher.jar cid:[EMAIL PROTECTED]
ant.jar cid:[EMAIL PROTECTED]
commons-collections-3.1.jar cid:[EMAIL PROTECTED]
commons-dbcp-1.2.1.jar cid:[EMAIL PROTECTED]
commons-el.jar cid:[EMAIL PROTECTED]
commons-pool-1.2.jar cid:[EMAIL PROTECTED]
jasper-compiler.jar cid:[EMAIL PROTECTED]
jasper-runtime.jar cid:[EMAIL PROTECTED]
jsp-api.jar cid:[EMAIL PROTECTED]
naming-common.jar cid:[EMAIL PROTECTED]
naming-factory.jar cid:[EMAIL PROTECTED]
naming-java.jar

Again CastClassException.. :(

2005-04-26 Thread Bruno Gonçalves




I wroten a Echo WebService:


package xpto;

public class Echo
{
 public String echoMethod(String arg)
 {
 return arg;
 }
}


and I did a WSDL2Java to create the stubs.

I invoke this way the stub:

 public String Test(String str){
  
  EchoServiceLocator service = new EchoServiceLocator();
  
  try{ 
   
   Echo port = service.getEcho();
   
   return port.echoMethod(str);
   
  }catch (Exception e)
  {
   System.err.println(e.getMessage());
   return null;
  }
 }


And I got an CastClassException...

Anybody... please, help me! :(


---
Bruno Vg






Re: exception when call.invoke

2005-04-26 Thread Bruno Gonçalves




I already did that but I exactly have the same problem! :(
How it can be possible?

Thanks anyway!

[EMAIL PROTECTED] wrote:

  
  
  What are you running this in ? In a standalone
client or in an application server (which one?)
  
  Why don't you try using wsdl2java and create
stub classes to use instead. It is far simpler.
  then your call to the web service just becomes:
  ret =
echoWebService.test(code,utilizador_portal,password);
  
  
-Original Message-
From: Bruno Gonalves [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 15, 2005 5:37 AM
To: axis-user@ws.apache.org
Subject: exception when call.invoke


Hi there!

I receive this exception:
java.lang.ClassCastException:
org.apache.axis.transport.http.HTTPSender


,when I execute this code:

  try {
   String endpoint = "http://localhost:8080/axis/Echo.jws";

   logger.info("DEBUG
 1");
   Service service =
new Service();
   logger.info("DEBUG
 2");
   Call call = (Call)
service.createCall();
   logger.info("DEBUG
 3");

  
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
  
call.setOperation("test");
  
call.addParameter("code", XMLType.XSD_STRING, ParameterMode.IN);
  
call.addParameter("utilizador_portal", XMLType.XSD_STRING,
ParameterMode.IN);
  
call.addParameter("password", XMLType.XSD_STRING, ParameterMode.IN);
  
call.setReturnType(XMLType.XSD_STRING);
   
   logger.info("DEBUG
 4");
  
//call.setOperationName(new QName("http://soapinterop.org/", "test"));
  
//logger.info("DEBUG  5");

   String ret =
(String) call.invoke(new Object[] {"123", "user", "passwd"});
= EXCEPTION!!
   logger.info("DEBUG
 6");

  
System.out.println("RESULT  '" + ret + "'");
   logger.info("DEBUG
 7");
  } catch (Exception e) {
  
System.err.println(e.toString());
  }

Any help? :(

---
Bruno Vg
 







[Fwd: ClassCastException when I call a function on my stubs]

2005-04-22 Thread Bruno Gonçalves




I already tried an older version,
and I got the same exception!
I supose that the problem is in my code :(

What can be the problem?

This is my code:


public class Webservices {

 static Logger logger = Logger.getLogger(Webservices.class);
 private int key = 333;
 
 public int Authentication(String username, String password){
  
  // Make a service
  AcessoPortalLocator service = new WS_AcessoPortalLocator();
  
  try {
   // Stub
   AcessoPortalSoapStub stub = (AcessoPortalSoapStub)
service.getPort(AcessoPortalSoap.class);
   
   // Authentication object
   Authentication authentication = new Authentication();
   
   // Define the fields for the verificaAutenticacao object
   authentication.setUser(username);
   authentication.setPass(password);
   authentication.setKey(key);
   
   // make the webservice call
   AuthenticationResponse resp = (AuthenticationResponse)
stub.Authentication(authentication);
   
   //return response
   return resp.getAuthenticationResult();
   
  } catch (Exception e) {
   System.err.println(e.getMessage());
  }
}



Thanks...

---
Bruno Vg



---BeginMessage---




I have an ClassCastException when I
call a function on my stubs, for example:
HelloWorldResponse resp = (HelloWorldResponse)
stub.helloWorld(helloWorld);


When debuging i find that the problem is in this section:

file: WSDDTargetedChain.java
 pivot =
(Handler)ClassUtils.forName(pivotQName.getLocalPart()).newInstance();
=== ClassCastException

I'm using Axis 1.2 RC3.
This is any bug?
humm.. maybe I will try a older version!

---
Bruno Vg




---End Message---


exception when call.invoke

2005-04-15 Thread Bruno Gonçalves




Hi there!

I receive this exception:
java.lang.ClassCastException:
org.apache.axis.transport.http.HTTPSender


,when I execute this code:

  try {
   String endpoint = "http://localhost:8080/axis/Echo.jws";

   logger.info("DEBUG
 1");
   Service service = new
Service();
   logger.info("DEBUG
 2");
   Call call = (Call)
service.createCall();
   logger.info("DEBUG
 3");

  
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
  
call.setOperation("test");
  
call.addParameter("code", XMLType.XSD_STRING,
ParameterMode.IN);
  
call.addParameter("utilizador_portal", XMLType.XSD_STRING,
ParameterMode.IN);
  
call.addParameter("password", XMLType.XSD_STRING,
ParameterMode.IN);
  
call.setReturnType(XMLType.XSD_STRING);
   
   logger.info("DEBUG
 4");
  
//call.setOperationName(new
QName("http://soapinterop.org/",
"test"));
   //logger.info("DEBUG
 5");

   String ret = (String)
call.invoke(new Object[] {"123",
"user", "passwd"}); = EXCEPTION!!
   logger.info("DEBUG
 6");

  
System.out.println("RESULT  '" + ret + "'");
   logger.info("DEBUG
 7");
  } catch (Exception e) {
  
System.err.println(e.toString());
  }

Any
help? :(

---
Bruno Vg







java.lang.ClassCastException

2005-04-14 Thread Bruno Gonçalves
Hi there!
I'm using Axis (1.2 RC3) on Tomcat 5.0.28, and when I run the TestClient 
or similar, I get a '/java.lang.ClassCastException/' when I call the 
call.invoke method:
/String ret = (String) call.invoke(new Object[] { Hello! });/

What I'm doing wrong? Any Help?
Thanks..
---
Bruno Vg