2017-08-16 219 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