Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Help with SOAP Monitor

I am attempting to use the built-in SOAP monitor on an LTM with 10.2.4.

I have made several attempts, but no success yet. Any help or advice would be much appreciated!

One of the biggest issues I have is how to I validate that the customer has given me a legitimate POST request and that I'm getting back the result they say I should? They claim to have verified using SOAP-UI, and tell me that this request should work but so far my pool members all fail this monitor.

Admittedly, I have very little SOAP knowledge and so I'm having trouble deconstructing the SOAP POST request the customer has provided me, with what I need to put in the fields of the monitor. Can someone help me identify what components of this request need to be included in my SOAP monitor fields and what goes where?

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Here is the POST, as provided by the customer:

Image Text

Here is the REPLY, as provided by the customer:

Image Text

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

I've never had much luck with the SOAP monitor myself, but it is easy enough to do this with a standard HTTP or HTTPS monitor. A few notes on that though.

1, you have a content-length of 251 but no content. Did they give you anything that should be in the body of the POST(the POST data)? The request as shown above is not valid and will probably throw errors at a minimum because the content-length is off, and may fail because there needs to be data in the body of the post.

2, you have Connection: Keep-Alive but for the purpose of the monitor you probably want Connection: Close

That being said, this is how I do my SOAP monitors

Send String:

POST http://qaesb.nscorp.com/EAS/CLEDRTest HTTP/1.1\r\nAccept-Encoding: gzip,deflate\r\nContent-Type: text/xml;charset=UTF-8\r\nSOAPAction: \"/CLEDRTest.serviceagent/CLEDRTestSOAP1/CLEDRTest\"\r\nHost: qaesb.nscorp.com\r\nUser-Agent: Apache-HttpClient/4.1.1 (java 1.5)\r\nConnection: Close\r\n\r\nYour 251 bytes of post body needs to go here\r\n

Receive String:

Success  (or whatever you want to look for in the response indicating success)

Lastly, as for validation, it depends if it is http or https. for http you can just telnet to the server on the http port and paste in your send string. If it is https, you will need to use openssl s_client -connect : and then paste in the string. When you do it this way, you need to convert all of the \r\n to a new line, and don't forget the double \r\n\r\n is a double new line(1 new line terminate the line, and then 1 blank line between the header and the body)

0
Comments on this Answer
Comment made 06-Oct-2014 by mimlo 1138
and it looks like I left the content-length header out, you just need to squeeze a Content-Length: 251\r\n where you want it.
0
Comment made 06-Oct-2014 by mimlo 1138
and my cut and paste was a little happy, the first part, the POST, should be POST /EAS/CLEDRTest HTTP/1.1\r\n The hostname should not be in the POST, only the path
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Just for clarity, with the above 2 corrections

POST /EAS/CLEDRTest HTTP/1.1\r\nAccept-Encoding: gzip,deflate\r\nContent-Type: text/xml;charset=UTF-8\r\nSOAPAction: \"/CLEDRTest.serviceagent/CLEDRTestSOAP1/CLEDRTest\"\r\nContent-Length: 251\r\nHost: qaesb.nscorp.com\r\nUser-Agent: Apache-HttpClient/4.1.1 (java 1.5)\r\nConnection: Close\r\n\r\nYour 251 bytes of post body needs to go here\r\n
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Thank you for your reply! I will go back and ask about content-length. So if I'm hearing you right, you recommend doing this in an HTTP monitor instead of the built-in SOAP monitor?

It is HTTP (vs HTTPS), so it sounds like that should make the validation of the reply easier. Can I put it in a cURL request to validate from the CLI?

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Ok, now that you have the image up, I see your body. It is portion after the blank line at the bottom.

As one person who doesn't know much SOAP to another, yes I recommend it. Being a static request/response, I don't see a huge value in using programatic SOAP methods to craft the data. A simple HTTP monitor works just fine.

You will need to escape all of your " in the body as \" Also, the content type given to you probably includes the white space. This can get tricky, are those spaces or tabs? As a rule I get rid of all white space and just run the body all together. That will make you have to re-calculate the content-length though. There are a few ways to do this, one being just count all the characters. Remember, \" is a single character(the \ is just used for the monitor to escape the ", it is never transmitted to the client)

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

I will try the HTTP monitor approach and come back and let you know how it goes. Thanks again!

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

One more question, do I count the \r\n as characters? \r = 1 character or 2?

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

the content length is only the body(starting with <soapenv: until the end), not the header. I usually remove all returns and spaces from the body so I don't have to deal with it, just run it all together so you only have a return at the end.

I believe for the purpose of computing content length, \r\n is a single character.

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

I am still having trouble with this. I've done a tcpdump of my monitor, and I get back a HTTP 500 error. I had the customer also do a tcpdump of him doing the request from SOAP-UI, and he gets 200 OK. I'm not sure where to go next. There are some differences in the request, but I'm not sure how to make the monitor request match the one he is generating? Anyone willing to look at some tcpdumps to help me decipher this?

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

sure, I'll look at the tcpdump and see what I can figure out

0
Comments on this Answer
Comment made 07-Oct-2014 by mimlo 1138
also, can you post your send string.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Thank you. I'm probably missing the obvious - but is there a way to attach those tcpdumps files to this thread?

0
Comments on this Answer
Comment made 07-Oct-2014 by Heidi 35
Hold on...that didn't paste in right.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
<P>'POST /EAS/CLEDRTest HTTP/1.1\r\nAccept-Encoding: gzip,deflate\r\nContent-Type: text/xml;charset=UTF-8\r\nSOAPAction: \"/CLEDRTest.serviceagent/CLEDRTestSOAP1/CLEDRTest\"\r\nContent-Length: 244\r\nHost: qaesb.nscorp.com:40020\r\nUser-Agent: Apache-HttpClient/4.1.1 (java 1.5)\r\nConnection: Close\r\n\r\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\r\n\"xmlns:v1=\"http://www.nscorp.com/tep/cletest/v1.0\">\r\n<soapenv:Header/>\r\n<soapenv:Body>\r\n<v1:CLETestRequest>?</v1:CLETestRequest>\r\n</soapenv:Body>\r\n</soapenv:Envelope>'</P>
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

After Connection: Close there should be only 2 \r\n\r\n

Then after that you need your post body, the

Your cotent length should be the number of characters in this last body section only, not any of the characters in the header. If you could post that section as text instead of a picture, I should be able to put it all together for you

0
Comments on this Answer
Comment made 07-Oct-2014 by mimlo 1138
nevermind, I see the full post now, give me a minute
0
Comment made 07-Oct-2014 by Heidi 35
Sorry for the confusion, I had a hard time getting it to post the string literally.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

put a Tab before your text and it will format it a little better.

Try this. I don't think you can have \r\n in the body, as I believe this signifies the end of the body. I believe you need to use just \n if you really want a newline in the body. I just remove them all for simplicity though, the server won't care about the formatting.

POST /EAS/CLEDRTest HTTP/1.1\r\nAccept-Encoding: gzip,deflate\r\nContent-Type: text/xml;charset=UTF-8\r\nSOAPAction: \"/CLEDRTest.serviceagent/CLEDRTestSOAP1/CLEDRTest\"\r\nContent-Length: 239\r\nHost: qaesb.nscorp.com:40020\r\nUser-Agent: Apache-HttpClient/4.1.1 (java 1.5)\r\nConnection: Close\r\n\r\n?\r\n

Also note that removing all the newlines shortened the content-length

0
Comments on this Answer
Comment made 07-Oct-2014 by mimlo 1138
ick, it looked fine in the preview, but it got cut off. so ignore my advice on formatting POST /EAS/CLEDRTest HTTP/1.1\r\nAccept-Encoding: gzip,deflate\r\nContent-Type: text/xml;charset=UTF-8\r\nSOAPAction: \"/CLEDRTest.serviceagent/CLEDRTestSOAP1/CLEDRTest\"\r\nContent-Length: 239\r\nHost: qaesb.nscorp.com:40020\r\nUser-Agent: Apache-HttpClient/4.1.1 (java 1.5)\r\nConnection: Close\r\n\r\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"xmlns:v1=\"http://www.nscorp.com/tep/cletest/v1.0\"><soapenv:Header/><soapenv:Body><v1:CLETestRequest>?</v1:CLETestRequest></soapenv:Body></soapenv:Envelope>\r\n
0
Comment made 07-Oct-2014 by mimlo 1138
If that doesn't work, telnet to the port on the server and paste this in to see what response code comes back POST /EAS/CLEDRTest HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: text/xml;charset=UTF-8 SOAPAction: "/CLEDRTest.serviceagent/CLEDRTestSOAP1/CLEDRTest" Content-Length: 239 Host: qaesb.nscorp.com:40020 User-Agent: Apache-HttpClient/4.1.1 (java 1.5) Connection: Close <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:v1="http://www.nscorp.com/tep/cletest/v1.0"><soapenv:Header/><soapenv:Body><v1:CLETestRequest>?</v1:CLETestRequest></soapenv:Body></soapenv:Envelope> After you hit enter on the last line, you should get a response. if you get a response before inputting the last line, something is wrong with the header
0
Comment made 07-Oct-2014 by Heidi 35
Ok, let me try the telnet...I didn't see this suggestion before now...I'll be back
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Thank you for your help! Unfortunately I took your string above and pasted into my monitor and I still have the same result....tcpdump shows the reply to the monitor request is a HTTP 500. Do you know how I can share the tcpdumps with you?

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

' HTTP/1.1 505 HTTP Version Not Supported Server: Apache-Coyote/1.1 Date: Tue, 07 Oct 2014 17:44:39 GMT Connection: close

Connection closed by foreign host.'

0
Comments on this Answer
Comment made 07-Oct-2014 by Heidi 35
That is the response I get from the telnet test.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

does that server not support HTTP/1.1? You can try HTTP/1.0. Get rid of the Connection: Close portion of the header

In the packet capture of the example they gave you that works, is it 1.1 or 1.0?

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

The working request in the tcpdump I have - specifies 1.1 as well. That one successfully returns a 200 OK.

I did just try the same request in telnet, but changed it to 1.0. Oddly enough, I get the same error - HTTP/1.1 505 HTTP Version Not Supported.

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Ok, so lets assume it is erroring on something other than the HTTP version.

I'm not sure how to attach a tcpdump here. In wireshark, you can right click on one of the packets and choose 'follow tcp stream' that will bring up a text representation of the request, hopefully allow you to compare them easily to see what is different. You can paste that in here if you want and I will look.

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Thank you for all of your help today, it has been invaluable. It will likely be tomorrow morning before I have an opportunity to dive deeper into the traces. I will be back on here then and let you know what I find.

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

I have a working monitor! Thanks to the help of my local F5 sales engineer a resident SOAP expert within F5 that he solicited for help (John Alam). He found two errors in my SOAP message - the URI following the POST message was incorrect. He found this by comparing my monitor string to the string in the SOAP request generated by SOAP-UI from my customer. The 2nd error he identified was missing whitespace in the SOAP envelope statement, before 'xmlns:v1'. Once I fixed those 2 errors - my pool members turned green. Thanks so much for all your help, mimlo!

0
Comments on this Answer
Comment made 3 months ago by Roflcopter 194

Would be be able to post your working string?

1