serialize to iso ?

S

Steph

hello, i have a classe.
I want serialize it into a define encoding string ... and send it by
webservice.



XmlWriterSettings writerSettings = new XmlWriterSettings();
writerSettings.Encoding =System.Text.Encoding.GetEncoding("ISO-8859-1");
StringWriter stringWriter = new StringWriter();
using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter, writerSettings))
{
_serializer.Serialize(xmlWriter,myobject);
}

string myXMLISO = stringWriter.ToString();


WS.GetType().GetMethod("myWS").Invoke(WS, new object[] { myXMLISO })


how do ?

thanks
 
M

Marc Gravell

Well, what does the "myWS" method look like? What are the arguments?
Note that by serializing to a string, it is ultimately going to be
UTF-16; if the method accepts a byte[] (or a base-64 string), you
could perhaps serialize to a MemoryStream.

However, my suspicion is that myWS accepts a typed object (such as
myobject). In which case, the web-service layers should be worrying
about this; are you getting a specific problem?

Marc
 
S

Steph

Marc said:
Well, what does the "myWS" method look like ? What are the arguments?
Note that by serializing to a string, it is ultimately going to be
UTF-16; if the method accepts a byte[] (or a base-64 string), you
could perhaps serialize to a MemoryStream.

However, my suspicion is that myWS accepts a typed object (such as
myobject). In which case, the web-service layers should be worrying
about this; are you getting a specific problem?

Marc

hello, the argument is a "string" : myWS(string myxml)
and webservice read "string" into a iso encoding !
so we need send the string not in utf-16 but in iso encoding... it is
the problem.
 

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

Top