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"?>

SOAP-ENV:Server
java.net.UnknownHostException: p700732-na.mtestnet.com

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

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).

HTH,

Mark

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=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:SOAP-ENC=“http://schemas.xmlsoap.org/soap/encoding/” xmlns:xsd=“XML Schema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
SOAP-ENV:Body
<SOAP-ENV:Fault xmlns:SOAP-ENV=“http://www.eps.fmr.com/etrservice”>
3000
100
Invalid request
</SOAP-ENV:Fault></SOAP-ENV:Body>
</SOAP-ENV:Envelope>

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=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=“XML Schema”>
SOAP-ENV:Body
SOAP-ENV:Fault
SOAP-ENV:Client
[ISS.0088.9134] Exception occurred while processing the body of the message
http://is6_gw_etrdev1:5550/soap/default

webM:exception
webM:classNamecom.wm.lang.flow.FlowException</webM:className>
<webM:message xml:lang=“”>3000</webM:message>
</webM:exception>

</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">[/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]http://www.eps.fmr.com/etrservice[/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 http://schemas.xmlsoap.org/soap/envelope/”.

Mark

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.
thanks:-)

Cheers,
Priya

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