You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Constantino Alarc?n Mery <in...@gmail.com> on 2006/07/04 21:09:51 UTC

Checked Exception - User Exception with Axis

Hello (my english is bad, sorry)

I need publish a class with axis. This class is:


public class MessageDelegate {
	public String getMessage() throws MessageFault {
		throw new MessageFault(99,"Mule error");
	}
}



The MessageFault exception is:



public class MessageFault {
	private int errorCode;
	private String errorDescr;
	public int getErrorCode() {
		return errorCode;
	}
	public String getErrorDescr() {
		return errorDescr;
	}
	public MessageFault(int errorCode, String errorDescr){
		this.errorCode = errorCode;
		this.errorDescr = errorDescr;
	}
}



I wish catch MessageFault exception in the client code:



public static void main(String args[]) {

	try {
		MessageDelegateService service = new MessageDelegateServiceLocator();
		MessageDelegate proxy = service.getMessageDelegate(...);
		System.out.println(proxy.getMessage());
	} catch (AxisFault af) {
		... ??
	}
}



I can not catch a exception. I dont know how do. 

Who can help me? I have not finding nothing about this axis exception
handler (URL, Article, ...)

-- 
View this message in context: http://www.nabble.com/Checked-Exception---User-Exception-with-Axis-tf1891417.html#a5171982
Sent from the Axis - User forum at Nabble.com.

Re: Checked Exception - User Exception with Axis

Posted by Constantino Alarc?n Mery <in...@gmail.com>.
I have an error:

<code>java.io.IOException: Type {http://www.w3.org/2001/XMLSchema}null is
referenced but not defined.
        at
org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(Symbol
Table.java:665)
        at
org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:545
)
.....
</code>

?Only in Axis 1.0, the User Custom Exception must extends of AxisFault
exception?I am generated webservices proxy (client) with Axis 1.3.



-- 
View this message in context: http://www.nabble.com/Checked-Exception---User-Exception-with-Axis-tf1891417.html#a5173662
Sent from the Axis - User forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Checked Exception - User Exception with Axis

Posted by Constantino Alarc?n Mery <in...@gmail.com>.
Hello

Thanks for your previous answer.

AxisFault is used for Soap Faults (AxisFault is a RemoteException).

I have an checked exception, (GenericExceptionFault extends
java.lang.Exception), I want catch GenericExceptionFault, but I dont think
how to do in Axis 1.0.

Please, I need your help.


public class AxisFault
extends java.rmi.RemoteException

An exception which maps cleanly to a SOAP fault. This is a base class for
exceptions which are mapped to faults. SOAP faults contain 
-- 
View this message in context: http://www.nabble.com/Checked-Exception---User-Exception-with-Axis-tf1891417.html#a5173758
Sent from the Axis - User forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Checked Exception - User Exception with Axis

Posted by John Duff <du...@gmail.com>.
I'm trying to generate a wsdl from a class that throws a AxisFault and
the fault tag is not generated in the wsdl, do I have to add the fault
definition myself?  I'm using Axis2 right now

Thanks,

John

On 7/4/06, Anne Thomas Manes <at...@gmail.com> wrote:
> Are you using Axis1? If so, then you want to define your exception to
> extend AxisFault.
>
> See:
> http://ws.apache.org/axis/java/apiDocs/org/apache/axis/AxisFault.html
> http://www.stylusstudio.com/api/axis-1_1/org/apache/axis/class-use/AxisFault.htm
> http://www.devx.com/ibm/Article/20250
> http://webservices.sys-con.com/read/39721.htm
>
> Anne
>
> On 7/4/06, Constantino Alarc?n Mery <in...@gmail.com> wrote:
> >  Hello (my english is bad, sorry) I need publish a class with axis. This
> > class is: public class MessageDelegate {
> >  public String getMessage() throws MessageFault {
> >  throw new MessageFault(99,"Mule error");
> >  }
> > }
> >
> >  The MessageFault exception is: public class MessageFault {
> >  private int errorCode;
> >  private String errorDescr;
> >  public int getErrorCode() {
> >  return errorCode;
> >  }
> >  public String getErrorDescr() {
> >  return errorDescr;
> >  }
> >  public MessageFault(int errorCode, String errorDescr){
> >  this.errorCode = errorCode;
> >  this.errorDescr = errorDescr;
> >  }
> > }
> >
> >  I wish catch MessageFault exception in the client code: public static void
> > main(String args[]) {
> >
> >  try {
> >  MessageDelegateService service = new
> > MessageDelegateServiceLocator();
> >  MessageDelegate proxy = service.getMessageDelegate(...);
> >  System.out.println(proxy.getMessage());
> >  } catch (AxisFault af) {
> >  ... ??
> >  }
> > }
> >
> >  I can not catch a exception. I dont know how do.
> >
> >  Who can help me? I have not finding nothing about this axis exception
> > handler (URL, Article, ...)
> > ________________________________
> >  View this message in context: Checked Exception - User Exception with Axis
> >  Sent from the Axis - User forum at Nabble.com.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Checked Exception - User Exception with Axis

Posted by Anne Thomas Manes <at...@gmail.com>.
Are you using Axis1? If so, then you want to define your exception to
extend AxisFault.

See:
http://ws.apache.org/axis/java/apiDocs/org/apache/axis/AxisFault.html
http://www.stylusstudio.com/api/axis-1_1/org/apache/axis/class-use/AxisFault.htm
http://www.devx.com/ibm/Article/20250
http://webservices.sys-con.com/read/39721.htm

Anne

On 7/4/06, Constantino Alarc?n Mery <in...@gmail.com> wrote:
>  Hello (my english is bad, sorry) I need publish a class with axis. This
> class is: public class MessageDelegate {
>  public String getMessage() throws MessageFault {
>  throw new MessageFault(99,"Mule error");
>  }
> }
>
>  The MessageFault exception is: public class MessageFault {
>  private int errorCode;
>  private String errorDescr;
>  public int getErrorCode() {
>  return errorCode;
>  }
>  public String getErrorDescr() {
>  return errorDescr;
>  }
>  public MessageFault(int errorCode, String errorDescr){
>  this.errorCode = errorCode;
>  this.errorDescr = errorDescr;
>  }
> }
>
>  I wish catch MessageFault exception in the client code: public static void
> main(String args[]) {
>
>  try {
>  MessageDelegateService service = new
> MessageDelegateServiceLocator();
>  MessageDelegate proxy = service.getMessageDelegate(...);
>  System.out.println(proxy.getMessage());
>  } catch (AxisFault af) {
>  ... ??
>  }
> }
>
>  I can not catch a exception. I dont know how do.
>
>  Who can help me? I have not finding nothing about this axis exception
> handler (URL, Article, ...)
> ________________________________
>  View this message in context: Checked Exception - User Exception with Axis
>  Sent from the Axis - User forum at Nabble.com.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org