Hello, This is my first post. I am not sure if this is the right forum, but I am having trouble within webMethods IS when trying to throw my own custom SOAP fault.
[SIZE=2]I am creating a SOAP service and want to create my own SOAP fault when a schema fails validation instead of throwing the regular wM SOAP fault that has a FaultCode of Server and a generic faultString stating exception while processing flow.
I am following the Gear 6.5 best practices which says “In order to throw a custom error message exception from the Integration Server, the flow service needs to invoke a Java service that throws a SOAP exception. The following code example shows the content of the Java service [/size]throwSoapException[SIZE=2]”.
I have created the custom java service that it describes:
// pipeline IDataCursor pipelineCursor = pipeline.getCursor(); String faultCode = IDataUtil.getString( pipelineCursor, "faultCode" ); String faultString = IDataUtil.getString( pipelineCursor, "faultString" ); String faultActor = IDataUtil.getString( pipelineCursor, "faultActor" ); String faultDetail = IDataUtil.getString( pipelineCursor, "faultDetail" ); String qualifyFaultCodeVal = IDataUtil.getString( pipelineCursor, "qualifyFaultCodeVal" ); pipelineCursor.destroy(); Boolean qualifyFaultCode = Boolean.valueOf( qualifyFaultCodeVal ); throw new SOAPException( faultCode, faultString, faultActor, faultDetail, qualifyFaultCode.booleanValue() );
The java service has compiled successfully but when I run the flow and I get to the call of the throwSoapException code, it always executes the next step after this service. I was assuming that it would automatically throw a SOAP Fault and exit the flow. It is not clear to me if I am missing a step.
Also please note that my service is not within a Try/Catch block. I notice within the Web Services best practices doc it does say that there is an extra step you need to do in order to throw an exception within the Catch Block, otherwise it executes the next step of the code. However I am not in a Try or catch block, so I don’t think that relates to what I am doing.
I am using Integration server: 6.5 service pack 2
I am sure someone will have an easy answer for me. Can anyone help?