SoapUI显示错误的响应

问题描述 投票:1回答:2

我试图从.asmx获取返回字符串,但是当我得到返回字符串(包含其他语言)时我发现问题,我无法读取它。

我的.asmx

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

我通过SoapUI调用HelloWorld(),如下图所示。

enter image description here

我得到返回字符串如下图所示。在XML中,这是正确的。

enter image description here

但在Raw中,这是不正确的。这是你好。“如何在上面得到正确的?

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>
c# web-services soapui asmx
2个回答
1
投票

您的asmx Web服务似乎将UTF-8转换为ASCII字符,您是否可以尝试将SOAP协议的版本从1.1版更改为1.2?

请按照此doc创建SOAP 1.2请求


0
投票

来自SoapUI响应的Raw无法显示其他语言的正确(非英语)。但是,我在Visual Studio上使用PL / SQL和服务引用调用此Web服务,然后响应可以正常显示其他语言的正确性。

© www.soinside.com 2019 - 2024. All rights reserved.