Question regarding building custom SOAP fault

I’m trying to follow the instructions for creating a SOAP-FAULT response in my processor and I’m stuck on the first step!

When calling documentToXmlString with my SOAP-FAULT document copied from a Web Service Connector, I get the following string result:

<?xml version="1.0"?>


which is obviously not valid Xml. Any thoughts? I’ve attached a screen shot of my document and the transformer step.

Map the SOAP-FAULT doc to a child document of the document input parameter to the documentToXMLString service. Rename that child document to “SOAP-ENV:Fault” and populate the nsDecls with the correct namespace for the “SOAP-ENV” prefix (as it appears that you have done).



i’m trying to develop custom soap fault and followed all the steps you have given above with namesapace and got the below output.

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=“” xmlns:SOAP-ENC=“” xmlns:xsd=“XML Schema” xmlns:xsi=“”>
<SOAP-ENV:Fault xmlns:SOAP-ENV=“”>
Invalid request

This soap fault is throwing an error at the client. But the soap fault that is produced using exit flow as failure works fine for the client.

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=“” xmlns:xsi=“” xmlns:xsd=“XML Schema”>
[ISS.0088.9134] Exception occurred while processing the body of the message

<webM:message xml:lang=“”>3000</webM:message>


Can anyone take a look at the soapfault and let me know how I can make it look like the system soap fault.

I tried removing name space in documenttoXMLstring. This is throwing a Invalid node: must be well-formed XML error.

Custom soap fault.

[FONT=Courier New][SIZE=2]
[/size][/font] [FONT=Courier New][SIZE=2]<?xml version="1.0" encoding="UTF-8"?>[/size][/font][FONT=Courier New][SIZE=2]
[/size][/font] [FONT=Courier New][SIZE=2]<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:SOAP-ENC="" xmlns:xsd="" xmlns:xsi="">[/size][/font][FONT=Courier New][SIZE=2]
[/size][/font] [FONT=Courier New][SIZE=2]<SOAP-ENV:Body>[/size][/font][FONT=Courier New][SIZE=2]
[/size][/font] [FONT=Courier New][SIZE=2]<SOAP-ENV:Fault xmlns:SOAP-ENV="[B][COLOR=Red][/color][/b]">[/size][/font][FONT=Courier New][SIZE=2]
[/size][/font] [FONT=Courier New][SIZE=2]<faultcode>3000</faultcode>[/size][/font][FONT=Courier New][SIZE=2]
[/size][/font] [FONT=Courier New][SIZE=2]<faultstring>100</faultstring>[/size][/font][FONT=Courier New][SIZE=2]
[/size][/font] [FONT=Courier New][SIZE=2]<faultactor>Invalid request</faultactor>[/size][/font][FONT=Courier New][SIZE=2]
[/size][/font] [FONT=Courier New][SIZE=2]</SOAP-ENV:Fault></SOAP-ENV:Body>[/size][/font][FONT=Courier New][SIZE=2]
[/size][/font] [FONT=Courier New][SIZE=2]</SOAP-ENV:Envelope>[/size][/font]

The namespace assigned to the soap envelope prefix (SOAP-ENV in your example) must be”.


Could anyone of you please tel me how to change the fault string.

Let me explain what i have done so far.

  1. I have created the webservice.(tried with setReponse service before the exit step and thn understood that exit step itself throws an service exception)
  2. Tested the same webservice using webconnector.
  3. getting an fault string as "Exception occurred while processing the body of the message ".

Now , i need to change the fault string as what I am getting as error message from the code, not the generic exception which recieved from service expection.

Thanks in advance!!!

I am done with the customized Soap fault.


Hi Priya,
Can you please tell me how you did that?
Actually I have a slightly different requirement.
My flow service when executed without any issues produces the below output:
I have the following structure for my service
Sequence (Main) set to Exit on success
Sequence (Try) set to Exit on failure
Under Try I have the business logic
Exit step which Has to signal success
Sequence (Catch) set to Exit on done
In case of any failures in Try block
Catch error and email
Exit Step whcih has to signal failure mandatorily
The above service is exposed as a webservice. This service when invoked by a webservice client with item number as input, it logs on to a db and gets the corresponding details which will be constructed as output as shown below: in case the try block has no errors

25464 Turbine 1 There is an adapter service in the try block. In case of any issues in invoking the adapter service, the code flow gets into the catch block. Then sends out an email and exits the flow signalling failure. Now the requirement is, the webservice client which invokes this webservice should not get any fault messages. The output should be a stadard message as shown below irrespective of what ever error occured in the try block -1 Fatal error in service execution If I set the exit step in the catch block to signal success and keep a map step before this exit step, I can get the above output. But it mandatory for me to set this exit step to signal failure as this will log the error message in monitor which I need for filtering failure messages when I use mywebMethods monitor so that it will be easy for the support team to monitor falied services. Because of this exit step, the webservice client receives a fault message which the user is not ready to accept. Can someone please suggest a workaround for this? Help much appreciated. Regards, Ravi