Main Site Documentation

Confusing error message from unhandled exception


#1

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?


#2

Were you able to resolve the issue?

I’m getting the same exception. Mine occurred when i used

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\svcUtil.exe

on a VS2010 project using the SimpleService DPWS code.


#3

MoonDragon haven’t been online since May 2012.
You can see this if go to his/her profile.

And I don’t see why you think it’s a common problem.
The exception printout from MoonDragon is clearly a Exception from an NETMF device.
But C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\svcUtil.exe is a windows program.

If you also get some ‘Unknown Encoding’ then it might be the Encoding.
NETMF supports UTF8 only.


#4

I saw that the user hasn’t been online in a long time so i knew it was a shot in the dark.

Additionally - maybe i wasn’t as clear - I know the exception is coming from the NETMF device - I was remarking on how the exception occurred when I used the svcUtil.exe program. ie when svcUtil queries the dpws device for information.

Would you happen to know if certain versions of the svcUtil don’t use UTF8 encoding? Maybe there is a switch for the service utility to use different encodings?


#5

You should check codeshare for DPWS code. https://www.ghielectronics.com/community/codeshare/entry/736 or https://www.ghielectronics.com/community/codeshare/entry/814 might be possible leads.


#6

Brett - thank you so much.

I finally got some free time to get back to this and your first link is exactly what I needed. Very motivational stuff. Although I’d like to see svcUtil work and get meta data etc.

I’ll post back here if I make any progress on that front.

Thanks again!