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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content