-
wsdd is great work, thanks a lot! One question: Like probably quite a lot of other people, I prefer to run software like this in a docker container, which actually works fine (I use this image: https://hub.docker.com/r/jonasped/wsdd ). I like to equip my docker containers with a healthcheck so that the docker ps list shows me if a container has stopped working. "Has stopped working" would mean in this case that the daemon for whatever reason is still running, but has stopped to respond. (if the process has ended, the container would die and docker would restart it as I told it so.) Testing that would therefore best be done by sending some sort of http request to the TCP listening port of wsdd. If a reply comes back within a certain timeframe, the container would be considered to still be operatin,g if not, then not. My idea would be to use either a curl request (using the --fail option) or a wget request (using the --spider option) of some sort. But quite frankly, I am not even sure I got the start right - as a test, I wanted to try a telnet connection to wsdd, but it would refuse to even open a connection. Is 5357 not the correct port to use? Apart from that: Any ideas what would be best as a simple http request to wsdd to seer whether it is still responding? I don't think any parsing of wsdd's replies are necessary. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Port 5357 is correct, but you won't be able to connect to wsdd via localhost because wsdd never binds to localhost as that wouldn't make sense and there may be a technical reason for it too which I do not remember right now.
A quick and dirty solution would be that one: Here is some rationale behind that "monster":
Using the above requests returns a 400 with "Invalid Content-Type". This actually originates from the wsdd logic so it may be used as indicator for a working wsdd instance. If you want to do more and want a 200 as return code (I think, curl would return an error otherwise with --fail), you need to post a full SOAP request, like this one (assumed to be stored in <?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<soap:Header>
<wsa:To>urn:uuid:ffffffff-ffff-ffff-ffff-ff0000000000</wsa:To>
<wsa:Action>http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</wsa:Action>
<wsa:MessageID>urn:uuid:027bec45-c37c-466c-936c-68f648abe2bb</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:From>
<wsa:Address>urn:uuid:49e131df-351a-4ece-9a6f-6a862d31cffa</wsa:Address>
</wsa:From>
</soap:Header>
<soap:Body></soap:Body>
</soap:Envelope> Note that the wsa:To URN is actually invalid here, because it does not refer to the wsdd host, and wsdd apparently does not check it. This may change in future versions, so you would be safe if you pass the correct uuid here (see above for code to derive it). You also should use a new MessageID for each message you send. Finally, that one would be some kind of heartbeat request:
HTH |
Beta Was this translation helpful? Give feedback.
Port 5357 is correct, but you won't be able to connect to wsdd via localhost because wsdd never binds to localhost as that wouldn't make sense and there may be a technical reason for it too which I do not remember right now.