michardy / upnp-honeypot

Honeypot for emulating UPNP devices
1 stars 0 forks source link

Identify XML library supporting xml namespaces #5

Open michardy opened 5 years ago

michardy commented 5 years ago

Soap requests use XML namespaces heavily. For example here is a SOAP request taken from Wikipedia

POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 299
SOAPAction: "http://www.w3.org/2003/05/soap-envelope"

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:m="http://www.example.org">
  <soap:Header>
  </soap:Header>
  <soap:Body>
    <m:GetStockPrice>
      <m:StockName>GOOG</m:StockName>
    </m:GetStockPrice>
  </soap:Body>
</soap:Envelope>

Unfortunately serde-xml currently does not support namespacing: https://github.com/RReverser/serde-xml-rs/issues/50 https://github.com/RReverser/serde-xml-rs/issues/62

Which leaves the question of how to read and write soap messages.

michardy commented 5 years ago

It appears XML namespacing is a mandatory part of the UPNP specification:

\ REQUIRED. Name of element is name of action to invoke. xml namespace attribute MUST be the service type enclosed in double quotes. The version specified MUST be the same version specified in the SOAPACTION header field.