Topic
3 replies Latest Post - ‏2013-06-29T11:40:55Z by some_cs_student
some_cs_student
some_cs_student
9 Posts
ACCEPTED ANSWER

Pinned topic REST messages via datapower XML firewall (handling HTTP codes)

‏2013-06-25T06:23:50Z |

I have a very simple use case where datapower is acting as a proxy, we want to have an audit log of who is using the service.

And we want to be able to do basic validation, we won't have a WSDL and I don't see the requirement to use an MPG which is shown on developerworks for using REST calls.

Both the calling system and the backend will use REST/XML.

The XML firewall is fine with XML but is having issues with HTTP codes, has anyone had to deal with this before? I will be doing some more testing in the next day or two so I'll have a bit more detail about this.

Updated on 2013-06-25T06:43:45Z at 2013-06-25T06:43:45Z by some_cs_student
  • HermannSW
    HermannSW
    3145 Posts
    ACCEPTED ANSWER

    Re: REST messages via datapower XML firewall (handling HTTP codes)

    ‏2013-06-25T10:28:15Z  in response to some_cs_student

    I do not see why you would not want to use a MPGW for this scenario.

    What do you want to do on DataPower request/response rule of the XML FW?

     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

  • JoeMorganNTST
    JoeMorganNTST
    257 Posts
    ACCEPTED ANSWER

    Re: REST messages via datapower XML firewall (handling HTTP codes)

    ‏2013-06-25T17:29:47Z  in response to some_cs_student

    I think you should better define "having issues with HTTP codes".  What issues?

     

  • some_cs_student
    some_cs_student
    9 Posts
    ACCEPTED ANSWER

    Re: REST messages via datapower XML firewall (handling HTTP codes)

    ‏2013-06-29T11:40:55Z  in response to some_cs_student

    Apologies about the delayed response I did not get emailed about the replies.

    HermannSW, almost nothing. The datapower in this case is a proxy, I just need a basic log that the service has been hit for audit purposes, and the ability to probe the content.

     

    JoeMorganNTST, the XML firewall appears to not handle different HTTP status codes very well. I'm finding that the MPG does not have these issues.

     For example, with the XML firewall set to XML for request/response, the request goes through fine to the backend (REST). The response returned is an empty response with HTTP status code 201 (created), the XML firewall is set to process empty message bodies.

    However, an error occurs in the datapower logs and the entry does not show up in the probe for an XML firewall. If the XML firewall is set to pass through mode for the response then everything is fine.

    Switching to an MPG the response code of 201 successfully passes through without an issue. Although I've found that in some cases the data returned is actually a PDF in the body, since this starts with a percent symbol (%) the datapower will not accept this as non-XML or XML, it has to be in pass through mode in the MPG or XML firewall.

    So I'm going to use a dynamic route depending on the type of request, if the request might be returning data such as a PDF it will call a pass through MPG, if not it will call an MPG with XML validation turned on. The main reason for this is so that we can see the data in the datapower probe for troubleshooting.

    Obviously there is nothing I can do when the data is in the PDF-style format so I'll just let that pass through.

    The new solution will involve an XML firewall (dynamic route) to one of two MPG's, one MPG with XML validation on response and one without. This should work for my current scenario.