如何在Liquid XML Studio中获取我的Web服务响应XML以进行验证?

时间:2022-12-15 17:18:46

Web Service code (ASP.NET 2.0):

Web服务代码(ASP.NET 2.0):

[WebMethod]
[return: XmlElement("TestMe")]
public string TestMe(int value)
{
  return value.ToString();
}

The will result in this response:

这将导致此响应:

<?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>
    <TestMeResponse xmlns="http://example.org/WebServiceTest">
      <TestMe>7499</TestMe>
    </TestMeResponse>
  </soap:Body>
</soap:Envelope>

If I save this as a XML file, open it up in Liquid XML Studio and try to validate it, I get this error message:

如果我将其保存为XML文件,请在Liquid XML Studio中打开并尝试验证它,我收到以下错误消息:

Could not find schema information for the element 'http://example.org/WebServiceTest:TestMeResponse'.
Could not find schema information for the element 'http://example.org/WebServiceTest:TestMe'

So how do I add the correct namespace and/or schema for this to validate correctly?

那么如何为此添加正确的命名空间和/或模式以正确验证?

My WSDL ...asmx?WSDL includes the schema definition for the TestMeResponse and TestMe elements, but how do I get this into the response?

我的WSDL ... asmx?WSDL包含TestMeResponse和TestMe元素的模式定义,但是如何将其纳入响应?

1 个解决方案

#1


1  

You don't put the schema in the response. It's in the WSDL. You'll need to pull the schema (or schemas) out of the WSDL for Liquid XML to see.

您不会将架构放在响应中。它在WSDL中。您需要从用于Liquid XML的WSDL中提取模式(或模式)才能看到。

#1


1  

You don't put the schema in the response. It's in the WSDL. You'll need to pull the schema (or schemas) out of the WSDL for Liquid XML to see.

您不会将架构放在响应中。它在WSDL中。您需要从用于Liquid XML的WSDL中提取模式(或模式)才能看到。