Announcement Announcement Module
Collapse
No announcement yet.
spring-ws exception mapping Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring-ws exception mapping

    Hi all,

    I have been using Axis + Spring for our web service solution before, and now I'm trying to implement one of our web service using spring-ws as a prototype. But I 'm haveing hard time to understand the exception/fault hadling following the aireline example. Whne using Axis, I defined the exception in the schema and then refer to them as fault in the wsdl, Axis will generate coresponding class which is the subclass of Axis fault. But in the airline example, I could not find the defination of the airline:NoMoreSeats or airline:NoSuchFlight anywhere. Could anybody explaine the approach of fault handling in spring-ws.

    Thanks in advance

  • #2
    Hi,

    Originally posted by quarksys View Post
    I have been using Axis + Spring for our web service solution before, and now I'm trying to implement one of our web service using spring-ws as a prototype. But I 'm haveing hard time to understand the exception/fault hadling following the aireline example. Whne using Axis, I defined the exception in the schema and then refer to them as fault in the wsdl, Axis will generate coresponding class which is the subclass of Axis fault. But in the airline example, I could not find the defination of the airline:NoMoreSeats or airline:NoSuchFlight anywhere. Could anybody explaine the approach of fault handling in spring-ws.
    A Soap 1.1 fault contains a code, string, and detail. The definitions of airline:NoMoreSeats and NoSuchFlight are SOAP Fault codes, which you don't define in the WSDL. If you look in the Spring-WS app context, you will also see the fault string being defined. The <wsdl:fault> in the WSDL defines the contents of the fault detail.

    Unfortunately, there is no way to declaratively configure the SOAP fault detail yet. However, you can write your own implementation of EndpointExceptionResolver which does that.

    Hope this helps,

    Comment


    • #3
      Thanks Arjen. I got it now. It would be nice to be able to communicate the SOAP fault with the the callling client using WSDL. Also I'm wondering it there is any plan to have a code generation utility for spring-ws.

      Thanks again

      Comment


      • #4
        Originally posted by quarksys View Post
        It would be nice to be able to communicate the SOAP fault with the the callling client using WSDL.
        You certainly can communicate existence of Faults to the client using WSDL. Arjen included a link to a part of the WSDL spec relating to exactly that. You don't need to describe the faults in the WSDL, though, but it is a good practice... especially if a client wants to use any WSDL-to-code generation tools.

        See WS-I Basic Profile (Enumeration of Faults) for their take on the interoperability of not including fault definitions in the WSDL.

        Comment

        Working...
        X