Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-657

Provide a way to deal with XSD validation exceptions in POX webservices with marshalling

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0 RC1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Reference: http://stackoverflow.com/questions/4207303/how-to-transform-exceptions-into-return-codes-using-spring-ws

      Spring-WS currently lacks the necessary functionality to be able to deal with exceptions resulting from

      • XSD Validation
      • Malformed XML parsing
        in the case of POX web services where error codes are returned as part of the regular response message instead of relying on faults

      For an endpoint like this:
      @Endpoint
      public class MyEndpoint() {
      private static final String MY_NAMESPACE=...;

      @PayloadRoot(namespace=MY_NAMESPACE, localPart="myPart")
      public MyPartResponse handleMyPart(MyPart myPart)

      { .... }
      }

      Using annotations and marshalling, I would like to propose the following syntax, in the spirit of what spring mvc does with binding errors (which frankly are semantically identical to the case discussed here):

      @Endpoint
      public class MyEndpoint() {
      private static final String MY_NAMESPACE=...;

      @PayloadRoot(namespace=MY_NAMESPACE, localPart="myPart")
      public MyPartResponse handleMyPart(MyPart myPart, Errors errors) { .... }

      }

      When a validation exception occurs (XSD or malformed XML) myPart would then be null and errors would contain the relevant validation error. The method can the construct the response accordingly.

      Cheers,
      Axel

        Attachments

          Activity

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              axelfont Axel Fontaine
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: