# Http Synthetic monitor using soap request and capture data from  response

**URL:** <https://community.dynatrace.com/t/http-synthetic-monitor-using-soap-request-and-capture-data-from-response/21419>\
**Category:** Synthetic Monitoring\
**Tags:** http-monitor\
**Created:** [February 4, 2021, 8:36pm UTC](https://community.dynatrace.com/t/http-synthetic-monitor-using-soap-request-and-capture-data-from-response/21419 "2021-02-04T20:36:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![teoderico\_david](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@teoderico\_david](https://community.dynatrace.com/u/teoderico_david)\
**Post date:** [February 4, 2021, 8:36pm UTC](https://community.dynatrace.com/t/http-synthetic-monitor-using-soap-request-and-capture-data-from-response/21419/1 "2021-02-04T20:36:49Z")

</div>

I have an API that I need to write a HTTP synthetic monitor but to run the API I need to first get the access token from a soap request xml response. My Problem is how I can get the access token from an XML response. Can any one please share how I can capture data from xml response using the HTTP synthetic monitor script mode.

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [February 4, 2021, 10:55pm UTC](https://community.dynatrace.com/t/http-synthetic-monitor-using-soap-request-and-capture-data-from-response/21419/2 "2021-02-04T22:55:48Z")

</div>

I don’t think Dynatrace will be able to make soap request but if you will have somehow XML response you should use post execution script.

response.getResponseBody()

using this method you will get whole string and you should be able to parse it at least using regex inside script.

Sebastian

---

<div class="post-metadata">

**Author:** ![hannahmac](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/hannahmac/32/41823_2.png) [@hannahmac](https://community.dynatrace.com/u/hannahmac)\
**Post date:** [February 5, 2021, 10:54am UTC](https://community.dynatrace.com/t/http-synthetic-monitor-using-soap-request-and-capture-data-from-response/21419/3 "2021-02-05T10:54:22Z")

</div>

SOAP requests can be made using HTTP Monitors. As Sebastian mentions, you can then use the post-execution script to get the response body and retrieve the access token. The access token can then be stored as a variable for use in other requests. You can find more information [here](https://www.dynatrace.com/support/help/how-to-use-dynatrace/synthetic-monitoring/http-monitors/pre-and-post-scripting-for-http-monitors/)

---

<div class="post-metadata">

**Author:** ![teoderico\_david](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@teoderico\_david](https://community.dynatrace.com/u/teoderico_david)\
**Post date:** [February 5, 2021, 2:48pm UTC](https://community.dynatrace.com/t/http-synthetic-monitor-using-soap-request-and-capture-data-from-response/21419/4 "2021-02-05T14:48:02Z")

</div>

Hi Sebatian and Hannah,

Thank you very much for your response. I was able to call the soap request using HTTP monitor and I also verified that the Access Token is in the response in xml format. I will do what you suggested to use regex.

Thanks again and I appreciate the help.

Teo

---

<div class="post-metadata">

**Author:** ![rchuquillan](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@rchuquillan](https://community.dynatrace.com/u/rchuquillan)\
**Post date:** [March 9, 2021, 4:37am UTC](https://community.dynatrace.com/t/http-synthetic-monitor-using-soap-request-and-capture-data-from-response/21419/5 "2021-03-09T04:37:32Z")

</div>

Hello teoderico\_david, I also want to monitor a soap request using http monitor, can you tell me the procedure you performed, I would be very grateful for your support.

---

<div class="post-metadata">

**Author:** ![deepikadeepa](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@deepikadeepa](https://community.dynatrace.com/u/deepikadeepa)\
**Post date:** [October 19, 2021, 11:48am UTC](https://community.dynatrace.com/t/http-synthetic-monitor-using-soap-request-and-capture-data-from-response/21419/6 "2021-10-19T11:48:52Z")

</div>

Can I get some example how to do that ?

---

<div class="post-metadata">

**Author:** ![hannahmac](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/hannahmac/32/41823_2.png) [@hannahmac](https://community.dynatrace.com/u/hannahmac)\
**Post date:** [October 19, 2021, 11:57am UTC](https://community.dynatrace.com/t/http-synthetic-monitor-using-soap-request-and-capture-data-from-response/21419/7 "2021-10-19T11:57:34Z")

</div>

Did you check the example in our documentation [here](https://www.dynatrace.com/support/help/how-to-use-dynatrace/synthetic-monitoring/http-monitors/pre-and-post-scripting-for-http-monitors/?_ga=2.147207543.1376151352.1634542414-719377197.1594986249&_gac=1.250359412.1634642976.CjwKCAjw2bmLBhBREiwAZ6ugo3gzTNkRk_L1gU3cmhR-N8KQ-AxSYFw624ceECACQ_2TfKhyjNqyJhoC6TEQAvD_BwE#example-monitor-)?
