0

I have a working solution for the requirement as stated below. However, I am NOT convinced that it is cleanly implemented. There are a lot of configuration options in DataPower that I am fuzzy on and though the response comes back, I am not confident about it. Can I get some help on how this should be implemented to avoid any quirky behavior.

Requirement When a SOAP client sends a request that fails schema validation rule in the inbound client->server policy (before going to backend server), our system needs to respond with custom SOAP Fault message and skip backside processing.

Current Solution

My MPG has the following rule configuration:

enter image description here

Client to Server. . .

matches all->sets on-error to call error rule->Validation Action-> . . .

Error rule . . .

matches validation error->sets skip-backside to true->transformation building custom SOAPFault message->results action->sets Content Type header

Any help on this or suggestions for a better way to do this would be helpful. I would like to do the schema validation inside the MPG and not a separate WS Firewall.

bearded_devil
  • 262
  • 2
  • 11

3 Answers3

1

Once error rule is triggered it will not go for backend. I think Skip backend is not required.

match function-->transformation action with custom message---> Results action

Joe
  • 48
  • 6
  • Thanks Jyo. I think I added the skip-backside only after the backend application was still being hit which was causing a timeout. I will try this again. Maybe I am missing a setting? – bearded_devil May 09 '16 at 17:08
1

Just add a validation action for the XSD in the MPGW Processing Policy. You don't need the skip-backside or on-error actions. Backside will be skipped on Request error and Error rule will always be triggered anyway. Apart from that your solution is solid.

Anders
  • 3,198
  • 1
  • 20
  • 43
0

<xsl:variable name="error" select="dp:variable('var://context/scratch/Response')"/> //invoke to another file as a working backend failed

    <error_message>
            <code><xsl:value-of select="$error/result/responsecode"/></code>
            //this type you can configure other responses
    </error_message>
toy
  • 1
  • 3
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30046257) – Smit Gajera Oct 11 '21 at 11:35