2017-08-16 220 views
1

我試圖從.asmx獲取返回字符串,但是當我得到返回字符串(包含其他語言)時發現問題,我看不懂它。SoapUI顯示不正確的響應

我的.asmx

public string HelloWorld(string message) 
{ 
    return message; 
} 

我打電話的HelloWorld()通過了SoapUI,如下圖所示。

enter image description here

我得到返回的字符串,如下圖所示。 在XML中,它是正確的。

enter image description here

但在原材料,這是不正確。它是你好เธชเธงเธฑเธชเธตเธต。如何得到正確的以上?

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> 
+0

我可以在圖像中看到你沒有傳遞Hello World?而是你傳遞Hello <一些其他語言> – Winnie

+0

我可以傳遞Hello <一些其他語言>,我可以在我的.asmx文件中調試,並且可以看到消息的值。 XML中的返回字符串是Hello 。 但是Raw中的返回字符串是Hello,它就是你自己的。 – akkapolk

回答

0

從原料響應了SoapUI無法顯示正確的另一種語言(非英語)的。 但是,我從Visual Studio的PL/SQL和服務參考調用此Web服務,然後響應可以正常顯示其他語言的正確。

0

看來你的ASMX Web服務轉換UTF-8ASCII字符,可以嘗試更改SOAP協議的版本從1.1版本到1.2?

關注這個doc創建SOAP 1.2請求

+0

嗨。這仍然是一樣的結果。我會找到如何在asmx中通過UTF-8進行響應。 – akkapolk