Pinned topic Handling soap faults
If backend sends soap fault to Datapower how should we handle such soap faults in Datapower.
Note:We also need to send soap fault to consumer.
swlinn 100000E7QE1398 Posts
Re: Handling soap faults2012-04-17T03:21:42ZThis is the accepted answer. This is the accepted answer.You could pass the soap fault from the backend straight thru to the client, and you could also have a custom stylesheet to create a soap fault in your error rule. Have process backend errors enabled so backend http errors are still processed by your response rule to do the passthru of the fault. If you want to augment this in your error rule, you can check the x-dp-response-code for a string that does not start with 200 and reject the request after placing the returned fault in a context variable. You get this response code via
<xsl:variable name="respCode" select="normalize-space(dp:response-header('x-dp-response-code'))"/>
You can then build your soap fault and pull in info from the backend fault.
SteveUpdated on 2014-03-25T02:57:42Z at 2014-03-25T02:57:42Z by iron-man
dpbuddies 270004VQ5C14 Posts
Re: Handling soap faults2012-05-03T20:16:32ZThis is the accepted answer. This is the accepted answer.
- swlinn 100000E7QE
HermannSW 2700006U546737 Posts
Re: Handling soap faults2012-05-03T23:47:59ZThis is the accepted answer. This is the accepted answer.
- dpbuddies 270004VQ5C
Depending on the backend SOAP encoding (1.1 or 1.2) please lookup store:///schemas/soap-envelope-1.x.xsd,
it will tell you what is required (required="true" or minOccurs>"0") and what is optional (minOccurs="0").
(minOccurs defaults to "1" if not specified)
ManishJ 270002GES024 Posts
Re: Handling soap faults2013-06-30T15:29:36ZThis is the accepted answer. This is the accepted answer.
- swlinn 100000E7QE
AS you mentioned that we may setup custom stylesheet to create a soap fault in our error rule. Do you have any sample xslt code to pass custom soap fault to client and how to use it under error rule?
I have a requirement to send a custom soap fault to client for couple of error scenarios - a) Schema validation error for request b) backend connection failure c) SLM rejection at front end. I have added a "on error" action at request rule and then setting slm, schema validation. It will invoke another rule (I have created response rule - should I create error rule?). I have created a response rule considering that after transformation result would be directed to service consumer client but it is not going there. I have aded a transformation action which is using xslt to fetch custmer soap fault xml file uploaded in Datapower to sent to client. XSLT is able to get handle of file but not sending it as a soap fault..
Would you please advise, if I need to do something to make it a) soap fault response b) pass it to client as response (while request schema validation is not a response from system but as it is a failure in DataPower, cleint want a custom SOAP fault). Please note that request response are SOAP version 1.1 but the custom soap fault does not contain standard 1.1 tags. Is it necessary to have standard tags only? Sample SOAP fault attached.
<?xml version="1.0" encoding="UTF-8"?>
<lc:FaultResponse xmlns:com="http://www.monster.com/cm/common/V3" xmlns:dt="http://www.monster.com/cm/rmDatatypes/V1" xmlns:int="http://www.monster.com/integration/core/V1" xmlns:lc="http://www.monster.com/API/LocalCollect/V0.8" xmlns:rd="http://www.monster.com/cm/referenceData/V2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.monster.com/API/LocalCollect/V0.8 MLSchemaV0_8.xsd ">
<lc:faultstring>Unknown Service Error</lc:faultstring>
<description>Service is unavilable due to an unknown reason.</description>
ManishUpdated on 2013-06-30T17:35:41Z at 2013-06-30T17:35:41Z by ManishJ