Topic
  • 4 replies
  • Latest Post - ‏2012-11-27T16:03:43Z by gwing
gwing
gwing
10 Posts

Pinned topic Error rule not triggering

‏2012-11-20T20:07:07Z |
I have successfully used error rules and on-error actions before, but this one has me stumped.

I have a policy that does:
(Binary Xform) --> (Error Action) --> (XSL Xform)--> (Result)

The binary Xform uses a WTX map to put an XML wrapper on the incoming message.
The XSL Xform sets a variable. It all works EXCEPT when I purposely send a bad
XML message. The Binary Xform wraps it as the MPGW is set to Non-XML. The XSL Xform throws an error "illegal character at offset 0". The log shows that the
error rule was selected for code '0x00030001'. The problem is I don't get my error message, I get the default SOAP-Fault message. Any ideas?? I need this to work.

Thanks in advance,
Dan
Updated on 2012-11-27T16:03:43Z at 2012-11-27T16:03:43Z by gwing
  • HermannSW
    HermannSW
    4661 Posts

    Re: Error rule not triggering

    ‏2012-11-21T19:22:54Z  
    You did not show the context where the XSL Xform gets its input from.
    Is it the output context of the Binary Xform action?
    If so, enabling Probe might give some insight.

    Or you insert the stylesheet from Debugging binary transaction data posting.
    (since you get parse errors, you have to log Non-XML data until issue is fixed)

     
    Hermann<myXsltBlog/> <myXsltTweets/>
  • gwing
    gwing
    10 Posts

    Re: Error rule not triggering

    ‏2012-11-21T19:42:25Z  
    • HermannSW
    • ‏2012-11-21T19:22:54Z
    You did not show the context where the XSL Xform gets its input from.
    Is it the output context of the Binary Xform action?
    If so, enabling Probe might give some insight.

    Or you insert the stylesheet from Debugging binary transaction data posting.
    (since you get parse errors, you have to log Non-XML data until issue is fixed)

     
    Hermann<myXsltBlog/> <myXsltTweets/>
    The XSL Xform gets it's input context from the Binary Xform. The reason for
    wrapping the incoming message is that the input could be SOAP or MIME and
    the WTX map can deal with that. This is working.

    What is failing is my ability to send back a custom error message when
    there is badly formed XML in the incoming SOAP message, not the XML wrapper.
    The DataPower will not allow (correctly) the bad XML to go to the backend
    system:

    <XML_wrapper>
    (missing less than sign)soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
    <soapenv:Header/>
    <soapenv:Body>
    PAYLOAD
    </soapenv:Body>
    </soapenv:Envelope>
    </XML_wrapper>

    I would expect that the on-error action would trap this error, but it's not.

    Thanks,
    Dan
  • HermannSW
    HermannSW
    4661 Posts

    Re: Error rule not triggering

    ‏2012-11-22T09:32:45Z  
    • gwing
    • ‏2012-11-21T19:42:25Z
    The XSL Xform gets it's input context from the Binary Xform. The reason for
    wrapping the incoming message is that the input could be SOAP or MIME and
    the WTX map can deal with that. This is working.

    What is failing is my ability to send back a custom error message when
    there is badly formed XML in the incoming SOAP message, not the XML wrapper.
    The DataPower will not allow (correctly) the bad XML to go to the backend
    system:

    <XML_wrapper>
    (missing less than sign)soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
    <soapenv:Header/>
    <soapenv:Body>
    PAYLOAD
    </soapenv:Body>
    </soapenv:Envelope>
    </XML_wrapper>

    I would expect that the on-error action would trap this error, but it's not.

    Thanks,
    Dan
    Please modify your config so that the Xform action sends directly to OUTPUT against a passthru loopback backend service.
    Set your reponse rule to passthru for that experiment.
    Then send a problemantic request to the modified service and store the response (the output of the binary Xform).
    Please attach such a problematic output here.

     
    Hermann<myXsltBlog/> <myXsltTweets/>
  • gwing
    gwing
    10 Posts

    Re: Error rule not triggering

    ‏2012-11-27T16:03:43Z  
    I was able to get the DataPower to trap the error for bad
    incoming XML. In the past I have never had to make any changes
    to the on-error action and everything was set to default.

    In order to trap the error and send back a custom error message
    the on-error configuration was changed to:
    Error Input: NULL (default: none)
    Error Output: OUTPUT (default: none)

    Hope this helps someone down the road.

    Dan