我試圖從.asmx獲取返回字符串,但是當我得到返回字符串(包含其他語言)時發現問題,我看不懂它。SoapUI顯示不正確的響應
我的.asmx
public string HelloWorld(string message)
{
return message;
}
我打電話的HelloWorld()通過了SoapUI,如下圖所示。
我得到返回的字符串,如下圖所示。 在XML中,它是正確的。
但在原材料,這是不正確。它是你好เธชเธงเธฑเธชเธตเธต。如何得到正確的以上?
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Encoding: gzip
Vary: Accept-Encoding
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-SourceFiles: =?UTF-8?B?RDpcQWtrYXBvbGtcUHJvamVjdFxzbXdcc2VydmljZXMuYXNteA==?=
X-Powered-By: ASP.NET
Date: Wed, 16 Aug 2017 07:36:37 GMT
Content-Length: 332
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><HelloWorldResponse xmlns="http://tempuri.org/"><HelloWorldResult>Hello เธชเธงเธฑเธชเธ」เธต</HelloWorldResult></HelloWorldResponse></soap:Body></soap:Envelope>
我可以在圖像中看到你沒有傳遞Hello World?而是你傳遞Hello <一些其他語言> – Winnie
我可以傳遞Hello <一些其他語言>,我可以在我的.asmx文件中調試,並且可以看到消息的值。 XML中的返回字符串是Hello。 但是Raw中的返回字符串是Hello,它就是你自己的。 –
akkapolk