Forums Register Login
AxisFault Server.userException
I�m doin a simple web service. the client program pass two parameters. If both of them are 0 a exception is thrown, and the client catch it. When the parameters aren�t 0, the web service return a string.

My problem is when the exception is thrown (when the parameters ar� not 0, the program works fine). This is the error:

faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultString: servicios.PruebaGPSException: La longitud y la latitud obtenidas s
on cero.
{http://xml.apache.org/axis/}hostname c-gorka

servicios.PruebaGPSException: La longitud y la latitud obtenidas son cero.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer
at clientes.proxies.PruebaGPSException.getDeserializer(PruebaGPSExceptio
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(B
at org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerA
at org.apache.axis.encoding.DeserializationContext.getDeserializer(Deser
at org.apache.axis.encoding.DeserializationContext.getDeserializerForTyp
at org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaul
at org.apache.axis.encoding.DeserializationContext.startElement(Deserial
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startEle
ment(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.
emptyElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scan
StartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown So
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Un
known Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(Deserialization
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnders
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
at org.apache.axis.client.Call.invoke(Call.java:2748)
at org.apache.axis.client.Call.invoke(Call.java:2424)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at clientes.proxies.PruebaWSSoapBindingStub.obtenerEnlace(PruebaWSSoapBi
at clientes.ClientePruebaGPS.main(ClientePruebaGPS.java:33)

Anybody knows what is wrong?

Thanks a lot, kemmotar
Hello "kemmotar aaa"-

Welcome to JavaRanch.

First a bit of business: On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.

As to your question, well, my Spanish is a bit weak, but it seems that the WS does not allow both inputs to be zero simultaneaously. So the solution is not to pass it two zeros.

First of all, forgive me. I read the form quickly.

The problem is that if i change the code, and i put that the exception is thrown when the parameters are 1, I have the same problem. My problem is when the web service throws the exception, when the exception is not thrown the web service work fine.

Thanks a lot
To explain better, "La longitud y la latitud obtenidas s
on cero."
is the text that it have to write when the exception is caught(catch(PruebaGPSException pge){pge.printStackTrace();})
So the problem is not that an exception is thrown (because that is by design), but that you need to catch it and then display the fault string to the user. You can test is the exception you catch is an instanceof org.apache.axis.AxisFault, and if it is, cast it to AxisFault. That has all kinds of methods to get at further error information, including the fault string.
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards

All times above are in ranch (not your local) time.
The current ranch time is
Oct 24, 2017 04:25:20.