0
我有一个发送html页面内容的PHP SOAP服务器(使用带有wsdl的nuSOAP)。当然,HTML可以用不同的编码进行编码,问题出现在这里。如果我使用了PHP SOAP客户端,我可以送的编码是这样的:在PHP肥皂服务器和c#soap客户端之间设置编码
$clienteSOAP = new SoapClient ("http://test.mine.com/wsdl/filemanager?wsdl",
array ('encoding' => 'ISO-8859-15'));
$clienteSOAP->__soapCall ("Test.uploadHTML",
array (file_get_contents ('/home/КОЛЛЕКЦИЯ_РОДНИК_ПРЕМИУМ.html')));
如果我把正确的编码,从来到目前为止还没有。但是当我使用C#客户端时,如何将编码放入Web服务请求中?在C#代码:
System.IO.StreamReader html = new System.IO.StreamReader (
"C:\\Documents and Settings\\КОЛЛЕКЦИЯ_РОДНИК_ПРЕМИУМ.html"
,System.Text.Encoding.GetEncoding("iso-8859-15"));
string contenido = html.ReadToEnd();
html.Close();
Test.FileManager upload = new Test.FileManager();
string resultado = upload.TestUploadHTML (contenido);
Test.FileManager是WSDL的Web引用,当我看到“上传HTML”,一些字符是不正确的。
在此先感谢。