Forum Discussion

Lee_Sutcliffe's avatar
Feb 15, 2013

Health monitors - XML API

Hi,

I'm trying to write a health monitor that sends an XML string, in order to receive some specific information. I've successfuly been able to replicate the query using cURL by replicating catured live, working traffic. However when I attempt to duplicate this into a health monitor I get a HTTP 400 Bad Request message:

This curl statement works and results in the output that follows, what is curious is that the first attempt fails with an authentication error but curl seems to try again and works. (some sensitive information has been removed)

curl -N -v \

-H 'Connection: Keep-Alive' \

-H 'Content-Type: text/xml; charset=utf-8' \

-H 'SOAPAction: "urn:domain-name.co.uk/service/check/Test"' \

--ntlm \

-u 'username:password' \

-d '' \

http://172.21.42.40:9003/service/check/11?wsdl

POST /Service/check/11?wsdl HTTP/1.1

Authorization: NTLM AAAAAAAAAAAAAAAAAAAAAAAAAAA=

User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5

Host: 172.21.42.40:9003

Accept: */*

Connection: Keep-Alive

Content-Type: text/xml; charset=utf-8

SOAPAction: "urn:domain-name.co.uk/service/check/Test"

Content-Length: 0

HTTP/1.1 401 Unauthorized

Content-Length: 0

Server: Microsoft-HTTPAPI/2.0

WWW-Authenticate: NTLM EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

Date: Thu, 14 Feb 2013 16:06:16 GMT

POST /service/check/11?wsdl HTTP/1.1

Authorization: NTLM AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==

User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5

Host: 172.21.42.40:9003

Accept: */*

Connection: Keep-Alive

Content-Type: text/xml; charset=utf-8

SOAPAction: "urn:domain-name.co.uk/service/check/Test"

Content-Length: 154

HTTP/1.1 200 OK

Content-Length: 428

Content-Type: text/xml; charset=utf-8

Server: Microsoft-HTTPAPI/2.0

Date: Thu, 14 Feb 2013 16:06:16 GMT

9ecb118c-486c-4581-afda-0b59d367ed7e2013-02-14T16:06:10.42

The following is the equivilent health monitor of the above curl statement, originally this errored as the header value Content-Length was missing. I added this manually with values of both 0 and 154 but each time monitor errors. From looking at a capture of the monitor the POST request appears to be identical to the working curl one

Monitor (actual carriage return entered for clarity)

monitor TEST_MON {

defaults from http

recv ""

send POST /service/check/11?wsdl HTTP/1.1\r\n

Authorization: NTLM AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\r\n

Host: 172.21.42.40:9003\r\nAccept: */*\r\n

Connection: Keep-Alive\r\n

Content-Type: text/xml; charset=utf-8\r\n

SOAPAction: \"urn:domain-name.co.uk/service/check/Test\"\r\n

Content-Length: 154\r\n\r\n

}

results in the following

POST /service/check/11?wsdl HTTP/1.1

Authorization: NTLM AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==

Host: 172.21.42.40:9003

Accept: */*

Connection: Keep-Alive

Content-Type: text/xml; charset=utf-8

SOAPAction: "urn:domain-name.co.uk/service/check/Test"

Content-Length: 154

HTTP/1.1 400 Bad Request

Content-Length: 0

Server: Microsoft-HTTPAPI/2.0

Date: Thu, 14 Feb 2013 16:53:01 GMT

Changing the content-length to 0 produces the following output


HTTP/1.1 400 Bad Request

Content-Type: text/html; charset=us-ascii

Server: Microsoft-HTTPAPI/2.0

Date: Fri, 15 Feb 2013 09:49:09 GMT

Connection: close

Content-Length: 326

Bad Request

Bad Request - Invalid Verb

HTTP Error 400. The request verb is invalid.

No RepliesBe the first to reply