Status code 500 to uri / soapaction


#1

Any ideas why I am getting some URIs in the POST trigger that contain soapactions, but in reality they do not. Meaning that I will get an output from the trigger that contains the POST URI (this one does not actually have a soap action) that receives a status code 500, but the trigger output contains the soapaction from the next POST message. Thanks

var soapAction,
headers = HTTP.headers;
if (event == “HTTP_REQUEST”) {
Flow.store.httpQuery = HTTP.query;
Flow.store.uri = HTTP.uri;
soapAction = headers[“SOAPAction”]
if (soapAction != null) {
Flow.store.soapAction = soapAction;

}
} else if (event == “HTTP_RESPONSE”) {
if (HTTP.statusCode == 500) {
if (HTTP.method == “GET”) {
var httpQuery = Flow.store.httpQuery || “Query Not Available”;
var httpuri = Flow.store.uri;
var clientIP = Flow.client.ipaddr;
var errorKeyget = "IP: " + clientIP + " HTTP Request: " + httpuri + " Query: " + httpQuery;

        Device.metricAddCount("HTTP_Queryg_Error", 1);
        Device.metricAddDetailCount("HTTP_Queryg_Error_Detail", errorKeyget, 1);
    } else if (HTTP.method == "POST") {
        var soapaction = Flow.store.soapAction
        var httpuri = Flow.store.uri;
        var clientIP = Flow.client.ipaddr;
        var errorKeypost = "IP: " + clientIP + " HTTP URI: " + httpuri + " SAction: " + soapaction;
        
        Device.metricAddCount("HTTP_Queryp_Error", 1);
        Device.metricAddDetailCount("HTTP_Queryp_Error_Detail", errorKeypost, 1);
        //Do stuff here with HTTP.payload (Requires Payload processing above 0)
        //May be easiest to start with a debug statement to take a look, and figure out what data
        //you would like to capture from the post.
        
        //debug(HTTP.payload);
    }
}

}


#2

Hi pmorse,

Not sure if I 100% understand the question but I have a suggestion. The URI property is available on both the request and response, so try removing the line that adds the URI to the flow store in the request and just access HTTP.uri on the response before you commit your metrics. This might be making stuff wonky.

Let me know if this has an effect.