Forum Discussion

Heidi_35827's avatar
Heidi_35827
Icon for Nimbostratus rankNimbostratus
Oct 06, 2014

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?

 

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

     

  • 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?

     

  • the content length is only the body(starting with

     

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

     

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

     

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

     

  • 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)

     

  • 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?

     

  • 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
    
  • 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)

    • mimlo_61970's avatar
      mimlo_61970
      Icon for Cumulonimbus rankCumulonimbus
      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
    • mimlo_61970's avatar
      mimlo_61970
      Icon for Cumulonimbus rankCumulonimbus
      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.