4.2 Registration
The following example shows the receiver attempting to register itself with the transmitter by calling the RegisterDevice action.
Receiver to Transmitter
-
POST /upnphost/udhisapi.dll?control=uuid:a7e63d3b-0a14-4143-b997-3cd79e20766b+urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar HTTP/1.1 Content-Type: text/xml; charset="utf-8" SOAPAction: "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1#RegisterDevice" User-Agent: Mozilla/4.0 (compatible; UPnP/1.0; Windows 9x) Host: 192.168.3.106:2869 Content-Length: 5903 Connection: Keep-Alive Cache-Control: no-cache Pragma: no-cache HTTP/1.1 100 Continue <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><m:RegisterDevice xmlns:m="urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1"><RegistrationReqMsg xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.Base64">Base64.Encoded Windows Media DRM for Network Devices Registration Request Message</RegistrationReqMsg></m:RegisterDevice></SOAP-ENV:Body></SOAP-ENV:Envelope>
The receiver sends a Base64-encoded data block [RFC3548] that contains the registration request message to the transmitter. The transmitter then responds by sending a Base64-encoded registration response message back to the receiver. The following example shows a registration response message.
Transmitter to Receiver
-
HTTP/1.1 200 OK Content-Length: 729 Content-Type: text/xml; charset="utf-8" Server: Microsoft-Windows-NT/5.1 UPnP/1.0 UPnP-Device-Host/1.0 Microsoft-HTTPAPI/1.0 Date: Wed, 07 Jul 2004 00:38:23 GMT <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><m:RegisterDeviceResponse xmlns:m="urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1"><RegistrationRespMsg xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.Base64">Base64.Encoded Windows Media DRM for Network Devices Registration Response Message </RegistrationRespMsg></m:RegisterDeviceResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
A receiver can also call the IsValidated action to determine whether or not it is registered with the transmitter. The following example shows a receiver checking its registration status.
Receiver to Transmitter
-
POST /upnphost/udhisapi.dll?control=uuid:a7e63d3b-0a14-4143-b997-3cd79e20766b+urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar HTTP/1.1 Content-Type: text/xml; charset="utf-8" SOAPAction: "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1#IsValidated" User-Agent: Mozilla/4.0 (compatible; UPnP/1.0; Windows 9x) Host: 192.168.3.106:2869 Content-Length: 401 Connection: Keep-Alive Cache-Control: no-cache Pragma: no-cache <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><m:IsValidated xmlns:m="urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1"><DeviceID xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="string"></DeviceID></m:IsValidated></SOAP-ENV:Body></SOAP-ENV:Envelope>
The receiver sends its device ID to the transmitter, and the transmitter responds to the receiver with either a 1 indicating that the receiver is currently registered or a 0 if the receiver is not registered.
Transmitter to Receiver
-
HTTP/1.1 200 OK Content-Length: 411 Content-Type: text/xml; charset="utf-8" Server: Microsoft-Windows-NT/5.1 UPnP/1.0 UPnP-Device-Host/1.0 Microsoft-HTTPAPI/1.0 Date: Wed, 07 Jul 2004 00:38:23 GMT <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><m:IsValidatedResponse xmlns:m="urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1"><Result xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="int">1</Result></m:IsValidatedResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
For more information on the RegisterDevice and IsValidated actions and their arguments, see section 6.