Sorry I have sent the email but it's not terminated and it is wrong. My service is:
<service name="MySearchPort" provider="java:RPC" style="rpc" use="encoded"> <parameter name="wsdlTargetNamespace" value="urn:MySearch"/> <parameter name="wsdlServiceElement" value="MySearchService"/> <parameter name="wsdlServicePort" value="MySearchPort"/> <parameter name="className" value="MySearchBindingImpl"/> <parameter name="wsdlPortType" value="MySearchPort"/> <operation name="doMySearch" qname="operNS:doMySearch" xmlns:operNS="urn:MySearch" returnQName="return" returnType="rtns:MySearchResult" xmlns:rtns="urn:MySearch" > <parameter name="query" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema"/> <fault name="doMyException" qname="fns:fault" xmlns:fns="urn:MySearch" class="DoMyExcep tion" type="tns:doMyException" xmlns:tns="urn:MySearch"/> </operation> <parameter name="allowedMethods" value="doMySearch"/> ..... <typeMapping xmlns:ns="urn:MySearch" qname="ns:doMyException" type="java:DoMyException" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> ........ Do you see any error? Thanks --Marco Il mer, 2003-08-27 alle 16:26, Cory Wilkerson ha scritto: > This question has been asked time and again and I've yet to see a real definitive > answer come through. For starters, you might want to try some of the Axis nightly > drops, I've had better luck with them serializing my exceptions. > > In the case where I have exceptions working, I've subclassed exception and according > to the jax-rpc specification (I don't know if Axis pays any attention here at all > with exceptions): > > 1. Provided accessors for each parameter supplied to my constructor (and conversely > ensured that each accessor had a parameter in the constructor). > 2. Ensured that the parameter type in constructor was identical to return type of > accessor. > 3. Ensured that there was only one accessor with a given return type (I actually > cheated here though I would expect I'll see some crazy results because of it.) > > I also am not sure if Axis appropriately generates fault elements in your WSDL based > on your exception type. If you don't see it in the WSDL you're generating stubs > against, you'll never see an "exception" in you client code. > > Good luck! > Cory > > > > -----Original Message----- > From: Marco Spinetti [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 27, 2003 9:13 AM > To: [EMAIL PROTECTED] > Subject: Soap Fault Explanation > > > Hi, > > I'm developing a soap web service with axis (my configuration is apache > + tomcat with axis). > > In some circumstances my web services has to create a SOAP fault which > has to be sent to the client. > > I'm a a bit confused with Axis management of SOAP fault (I've tried to > read email in mailing list but without success too). > > I've declared my Exception: > > public class DoMyException extends org.apache.axis.AxisFault > implements java.io.Serializable { > private int codice; > private java.lang.String stringa; > > public DoMyException() { > } > > public DoMyException( > int codice, > java.lang.String stringa) { > this.codice = codice; > this.stringa = stringa; > } > ....... > } > > In my web services method, in some circumstances, I throw such > exception: > > public MySearchResult doMySearch(java.lang.String query) throws > java.rmi.RemoteException, DoMyException { > > ...... > > try { > if (cond) { > throw new DoMyException(1, "Description"); > } > } > catch (DoMyException e) { > ...... > throw e; > } > ..... > } > > > When in my test client I try to generate a SOAP fault I don't receive > anything. With SOAPMonitor I see the request SOAP message but not the > response. > > My client: > > try { > MySearchService service = new MySearchServiceLocator(); > MySearchPort port = service.getMySearchPort(); > > ......... > MySearchResult r = port.doMySearch(query); > > ..... > } > catch (DoMyException e) { > System.err.println("Cod = " + e.getCodice()); > System.err.println("String = " + e.getStringa()); > System.exit(1); > } > > > Probably I'm making some mistakes but I don't see where. > > Any help would be very useful. > > Thanks > > > Bye > > --Marco > > > >