How to handle exceptions for XML validation on SwitchYard

Solution Unverified - Updated -

Issue

  • I configured @OperationTypes to validate the XML content and want to control the next route with the validation result.
  • If the XML is valid, I want to access an external web service with the XML content, otherwise I want to create a result file (XML) in a folder.
  • I saw something like this in the quickstarts but do not know how I can control and react in case the XML is not valid.

    @OperationTypes(in = "{urn:switchyard-quickstart:validate-xml:0.1.0}order", fault = "org.switchyard.quickstarts.camel.binding.InputXmlException")
    void greet(String inputXml);
    
  • I created a class named InputXmlException but am not sure what this class should do and what it should implement/extend.

Environment

  • Red Hat JBoss Fuse (Fuse)
    • 6.2
  • Red Hat JBoss Fuse Service Works (FSW)
    • 6.0
  • SwitchYard

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.