My latest mess-around project is trying to get DPWS up and running on my Spider board. I may have bitten off more than I can chew, as I never dealt with web services before, but it’s a fun–sometimes frustrating–learning experience.
My biggest problem are error messages when things break. I’m having a heck of a time trying to figure out what went wrong and why. Finally, I downloaded the full code for NETMF and came across something interesting. Here’s a printout of one of my confusing error messages:
#### Exception System.Xml.XmlException - CLR_E_PIN_DEAD (6) ####
#### Message:
#### System.Xml.XmlReader::Read [IP: 00d1] ####
#### System.Xml.XmlReader::MoveToContent [IP: 0031] ####
#### System.Xml.XmlReader::ReadStartElement [IP: 0004] ####
#### Ws.Services.Encoding.TextMessageEncodingBindingElement::OnProcessInputMessage [IP: 01d5] ####
#### Ws.Services.Binding.BindingElement::ProcessInputMessage [IP: 0019] ####
#### Ws.Services.Binding.ReplyChannel::ReceiveMessage [IP: 0016] ####
#### Ws.Services.Binding.ReplyChannel::ReceiveRequest [IP: 000d] ####
#### Ws.Services.Transport.HTTP.WsHttpServiceHost::Listen [IP: 0009] ####
A first chance exception of type 'System.Xml.XmlException' occurred in System.Xml.dll
For the life of me, I could not figure out what the hell CLR_E_PIN_DEAD is supposed to mean. But after digging through NETMF code, I found out that it is actually this line of code that throws the exception:
throw new XmlException((XmlException.XmlExceptionErrorCode)hresult);
Where hresult = 0xd5000000. Looking up XmlExceptionErrorCode, I get that:
UnknownEncoding = unchecked((int)0xD5000000), // XML_E_UNKNOWN_ENCODING
Now, I may be off my rocker here, but “unknown encoding” is a lot more meaningful–if not useful–error than “dead pin”.
I’m assuming that there is some “unhandled exception” handler that prints out the above debug output and attempts to cast the error message to something helpful. But instead of helping, it’s actually confusing. Can someone shed some more light on this please?