Hello
I am getting the following error message when I try and send an XML sting to
a web service, I read somewhere that most web services prefer ascii and some
throw errors when using unicode so I have changed the encoding but still cant
get rid of the error.
System.Xml.XmlE xception: '', hexadecimal value 0x00, is an invalid
character. Line 6, position 124. at System.Xml.XmlS canner.ScanHexE ntity() at
System.Xml.XmlT extReader.Parse BeginTagExpandC harEntities() at
System.Xml.XmlT extReader.Read( ) at System.Xml.XmlR eader.ReadEleme ntString()
at
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.ReadSoa pException(XmlR eader
reader) at
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.ReadRes ponse(SoapClien tMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall) at
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.Invoke( String
methodName, Object[] parameters) at
SMSservices.SMS Services.sendSM Ssender(String Messages, String Sender, String
Key) at ASP.Authenticat e_aspx.Page_Loa d(Object Src, EventArgs E) in
C:\temp\SMS\Aut henticate.aspx: line 99
As you can see below there is no null, in my string The string that I use is
messageStr =
"<SMSBatchFile> <SMSMessage><Me ssageID>1</MessageID><Mess ageText>test</MessageText><De stination>40123 123</Destination></SMSMessage></SMSBatchFile>";
Encoding ascii = Encoding.ASCII;
Byte[] encodedBytes = ascii.GetBytes( messageStr);
strXML = ascii.GetString (encodedBytes);
Has anyone encountered this?
I am getting the following error message when I try and send an XML sting to
a web service, I read somewhere that most web services prefer ascii and some
throw errors when using unicode so I have changed the encoding but still cant
get rid of the error.
System.Xml.XmlE xception: '', hexadecimal value 0x00, is an invalid
character. Line 6, position 124. at System.Xml.XmlS canner.ScanHexE ntity() at
System.Xml.XmlT extReader.Parse BeginTagExpandC harEntities() at
System.Xml.XmlT extReader.Read( ) at System.Xml.XmlR eader.ReadEleme ntString()
at
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.ReadSoa pException(XmlR eader
reader) at
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.ReadRes ponse(SoapClien tMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall) at
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.Invoke( String
methodName, Object[] parameters) at
SMSservices.SMS Services.sendSM Ssender(String Messages, String Sender, String
Key) at ASP.Authenticat e_aspx.Page_Loa d(Object Src, EventArgs E) in
C:\temp\SMS\Aut henticate.aspx: line 99
As you can see below there is no null, in my string The string that I use is
messageStr =
"<SMSBatchFile> <SMSMessage><Me ssageID>1</MessageID><Mess ageText>test</MessageText><De stination>40123 123</Destination></SMSMessage></SMSBatchFile>";
Encoding ascii = Encoding.ASCII;
Byte[] encodedBytes = ascii.GetBytes( messageStr);
strXML = ascii.GetString (encodedBytes);
Has anyone encountered this?
Comment