System.ArgumentException: Invalid or unsupported code page type.

L

lankylad

I have developed a Web Service for internal company use that consumes a public web service over the web. This works perfectly on my local development machine, but bombs out on the production machine with the following:

System.Net.WebException: The request was aborted: The request was canceled. ---> System.TypeInitializationException: The type initializer for "HeaderEncoding" threw an exception. ---> System.ArgumentException: Invalid or unsupported code page type.
at System.Text.CodePageEncoding.GetCPMaxCharSizeNative(Int32 codePage)
at System.Text.CodePageEncoding..ctor(Int32 codepage)
at System.Text.Encoding.GetEncodingRare(Int32 codepage)
at System.Text.Encoding.GetEncoding(Int32 codepage)
at System.Net.HeaderEncoding..cctor()
--- End of inner exception stack trace ---
at System.Net.HeaderEncoding.GetBytes(String myString, Int32 charIndex, Int32 charCount, Byte[] bytes, Int32 byteIndex)
at System.Net.HttpWebRequest.MakeRequest()
at System.Net.HttpWebRequest.EndSubmitRequest()
at System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean ignoreShutDownCheck)
--- End of inner exception stack trace ---
at System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean ignoreShutDownCheck)
at System.Net.ConnectStream.CloseInternal(Boolean internalCall)
at System.Net.ConnectStream.Close()
at MyWS.Search.SendMessage(Object dsout, Object dsin) in c:\inetpub\wwwroot\MyWS\Search.asmx.vb:line 321

Line 321 is:

myStream.Close()

The context is:

myRequest = System.Net.HttpWebRequest.Create(CHurl)
myRequest.ContentType = "text/xml; charset=utf-8"
myRequest.Timeout = 60000
myRequest.Method = "POST"
myStream = myRequest.GetRequestStream()
dsout.WriteXml(myStream)
myStream.Close()
myStream = Nothing


I am completely lost and would really appreciate some help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top