Hi,
i want to talk about exception handling.
I'm using a SoapFaultMappingExceptionResolver with this configuration
Ok, that's fine. But please think about this.Code:<property name="defaultFault"> <value>RECEIVER,Server error</value> </property> <property name="exceptionMappings"> <props> <prop key="org.springframework.oxm.UnmarshallingException">SENDER,Invalid request</prop> <prop key="org.springframework.oxm.ValidationFailureException">SENDER,Invalid request</prop> </props> </property>
I have this web service: XYZObject getXYZObject(id)
If an object with a given id doesn't exist, what should i do?
Should i create something like a SOAPFault object in my Endpoint code and return it in the invokeInternal method?
Or should my endpoint code throw an XYZObjectNotFoundException and use the SoapFaultMappingExceptionResolver to return this exception to the client?
What's the better way?
Are there other ways?
It would be also nice to map SOAPFault codes of my XYZObjectNotFoundException to message constants defined in my XSD.
How can i do this?
I know i can define an xml schema enumeration for my error message constants, but how can i link an XYZObjectNotFoundException to a schema enumeration?
Cheers,
Ingo


Reply With Quote