This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Handling Exception in Axis  RSS feed

 
Constantine Alarc�n
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I had trying propagate checked exceptions from POJO class to Client Web Services Class, but, I can not get a real Exception.

Example:

I have a Delegate Class:

public class MessageDelegate {

public String getMessage2() throws RemoteException, GenericException {
try {
Context ctx = new InitialContext();
Object objRemote = ctx.lookup("MessageHome");
MessageHome msgHome =
(MessageHome)PortableRemoteObject.narrow(objRemote,MessageHome.class);
Message msgRemote = msgHome.create();
msgRemote.getMessage2();
} catch (Exception e) {
e.printStackTrace();
}
}
}

I want deploy class as webservices (using axis)

In the proxy client code, I have:

public class ClientExample01 {
public static void main(String args[]) throws Exception {
try {
MessageDelegateService service = new MessageDelegateServiceLocator();
MessageDelegate proxy =
service.getMessageDelegate(
new URL("http://localhost:9080/ExceptionHandleWeb/services/MessageDelegate"));
System.out.println(proxy.getMessage());
System.out.println(proxy.getMessage2());
} catch (AxisFault e) {
e.printStackTrace();
}
}
}

My problem: I want capture (catch) a "GenericException" class, but, I can not do, I dont know.

Please, I need your help.

Mi ingl�s es malito, pero espero que se entienda.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!