Specify soap:Fault faultstring in Fuse Service Works

Solution Verified - Updated -

Issue

  • We have a SwitchYard project with a SOAP-binding and generated Java interface and parameter and result types from the wsdl.
  • When the bean throws a RuntimeException, how can we control what the faultstring will be in the returned soap-fault?
  • Now we get the included fault. But we want the faultstring to be <faultstring>This should be the only error text returned!</faultstring>.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"></SOAP>
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Server</faultcode>
         <faultstring>org.switchyard.HandlerException: java.lang.RuntimeException: This should be the only error text returned!</faultstring>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

Environment

  • Red Hat JBoss Fuse Services Works (FSW)
    • 6.x
  • Apache CXF

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.