# How To receive a SOAP Response message from web service

**URL:** <https://discuss.elastic.co/t/how-to-receive-a-soap-response-message-from-web-service/114868>\
**Category:** Logstash\
**Created:** [January 10, 2018, 12:31pm UTC](https://discuss.elastic.co/t/how-to-receive-a-soap-response-message-from-web-service/114868 "2018-01-10T12:31:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![s1m0ne](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1m0ne/32/26471_2.png) [@s1m0ne](https://discuss.elastic.co/u/s1m0ne)\
**Post date:** [January 10, 2018, 12:31pm UTC](https://discuss.elastic.co/t/how-to-receive-a-soap-response-message-from-web-service/114868/1 "2018-01-10T12:31:31Z")

</div>

Hi Folks,

 ![ELK_Soap_ReqResp](https://us1.discourse-cdn.com/elastic/original/3X/a/b/ab2dc9206c8159528c1a096835f5093875b8b47d.png)

NOTE: Logstash version 5.6.2

Currently, I receive events in **(json format)** from apache kafka and I use logstash with **HTTP Output plugin** for sending **SOAP Request message** to Web Service, via WSDL.

> output {  
> http {  
> url =\> "[ABC.NET](http://abc.net/ws/wb.svc?singleWsdl)"  
> http\_method =\> "post"  
> content\_type =\> "text/xml;charset=UTF-8"  
> headers =\> {  
> "SOAPAction" =\> "[ABC.NET](http://abc.net/wb/mySOAPAction)"  
> }  
> format =\> "message"  
> message =\> '\<?xml version="1.0" encoding="UTF-8"?\>\<soapenv:Envelope xmlns:ent="[ABC.NET](http://abc.net/wb/abc)" xmlns:soapenv="[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)"\> xmlns:soapenv="[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)"\>soapenv:Headerpwduid\</soapenv:Header\>soapenv:Body\>ent:mySOAPAction\</ent:mySOAPAction\>\</soapenv:Body\>\</soapenv:Envelope\>'  
> }  
> ...other output plugin..  
> }

my goal is to receive the SOAP Response message in Logstash and forward to kafka in json format but I do not find any official plugin that support this functionality.

Do you have any experience/suggestion which plugin or strategy I can use to receive those SOAP Response?

Many thanks in advance for your response.  
Cheers,  
s1m0ne

---

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [January 10, 2018, 4:17pm UTC](https://discuss.elastic.co/t/how-to-receive-a-soap-response-message-from-web-service/114868/2 "2018-01-10T16:17:11Z")

</div>

As I don't have access to a SOAP endpoint I can't test any suggestions.

Some folks on here have tried the http\_poller plugin. However you said you want XML to JSON conversion and that is a problem because we don't have a XML codec to decode the XML to a LS Event.

The XML filter uses XPath to "pluck" values out of the XML and add them with keys to an event and that may work for you.

`http_poller -> xml filter -> kafka output + json codec`

---

<div class="post-metadata">

**Author:** ![s1m0ne](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1m0ne/32/26471_2.png) [@s1m0ne](https://discuss.elastic.co/u/s1m0ne)\
**Post date:** [January 11, 2018, 10:37am UTC](https://discuss.elastic.co/t/how-to-receive-a-soap-response-message-from-web-service/114868/3 "2018-01-11T10:37:13Z")

</div>

Hi @guyboertje,

thank you for your response.

Actually, I am thinking to use HTTP\_Poller Input Plugin for this purpose but the http\_poller performes async request to wdsl (setting up polling interval attribute) and I concern about the performance and resilience of LS plugin.

Regarding the XML Filter, I would forward the soap response as I receive, to kafka topic in json format.

Cheers,  
s1m0ne

---

<div class="post-metadata">

**Author:** ![Nonow53](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nonow53/32/81767_2.png) [@Nonow53](https://discuss.elastic.co/u/Nonow53)\
**Post date:** [January 15, 2018, 4:10pm UTC](https://discuss.elastic.co/t/how-to-receive-a-soap-response-message-from-web-service/114868/4 "2018-01-15T16:10:30Z")

</div>

Hi @s1m0ne,

Could you post your logstash pipeline please ?  
I try to work with http\_poll to call SOAP Service but I don't understand why my conf not works...

thanks 😉

@Nonow53

---

<div class="post-metadata">

**Author:** ![Nonow53](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nonow53/32/81767_2.png) [@Nonow53](https://discuss.elastic.co/u/Nonow53)\
**Post date:** [January 15, 2018, 4:11pm UTC](https://discuss.elastic.co/t/how-to-receive-a-soap-response-message-from-web-service/114868/5 "2018-01-15T16:11:33Z")

</div>

My pipeline

input {  
http\_poller {  
urls =\> {  
testVersion =\> {  
method =\> post  
url =\> "[https://forge.douane/mantis/api/soap/mantisconnect.php](https://forge.douane/mantis/api/soap/mantisconnect.php)"  
headers =\> {  
"Content-Type" =\> "text/xml; charset=UTF-8"  
"SOAPAction" =\> "urn:mc\_version"  
}  
body =\> '\<?xml version="1.0" encoding="UTF-8"?\>  
\<soapenv:Envelope xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)" xmlns:xsd="[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)" xmlns:soapenv="[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)" xmlns:man="[http://futureware.biz/mantisconnect](http://futureware.biz/mantisconnect)"\>  
soapenv:Header/  
soapenv:Body  
\<man:mc\_version soapenv:encodingStyle="[http://schemas.xmlsoap.org/soap/encoding/](http://schemas.xmlsoap.org/soap/encoding/)"/\>  
\</soapenv:Body\>  
\</soapenv:Envelope\>'  
}  
}  
request\_timeout =\> 30  
schedule =\> @every 30s  
codec =\> "plain"  
# A hash of request metadata info (timing, response headers, etc.) will be sent here  
metadata\_target =\> "http\_poller\_metadata"  
}  
}  
output {  
stdout {  
codec =\> rubydebug  
}  
}

---

<div class="post-metadata">

**Author:** ![Nonow53](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nonow53/32/81767_2.png) [@Nonow53](https://discuss.elastic.co/u/Nonow53)\
**Post date:** [January 16, 2018, 9:05am UTC](https://discuss.elastic.co/t/how-to-receive-a-soap-response-message-from-web-service/114868/6 "2018-01-16T09:05:42Z")

</div>

Hi,

I find the problem, it is my property "schedule".  
It must be a hash.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 13, 2018, 9:06am UTC](https://discuss.elastic.co/t/how-to-receive-a-soap-response-message-from-web-service/114868/7 "2018-02-13T09:06:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
