繁体   English   中英

SOAPUI-该文档不是信封

[英]SOAPUI -The document is not an envelope

我有一个用C#编写的简单Web服务,它仅需2个数字即可为您提供总和。在浏览器中对其进行测试时,它可以正常工作,但是当我将该服务导入SOAPUI并尝试对其进行测试时,它给了我以下错误:

第-1行:错误:文档不是信封@ http://www.w3.org/2003/05/soap-envelope :文档元素不匹配出现了html @ http://www.w3.org/1999/xhtml

这是在左窗口(请求)中显示的内容:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Add xmlns="http://tempuri.org/">
      <x>1</x>
      <y>1</y>
    </Add>
  </soap:Body>
</soap:Envelope>

这是在右窗口中显示的内容(响应):

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
      <title>IIS7</title>
      <style type="text/css">
         <!--body {
    color:#000000;
    background-color:#B3B3B3;
    margin:0;
}

#container {
    margin-left:auto;
    margin-right:auto;
    text-align:center;
    }

a img {
    border:none;
}-->
      </style>
   </head>
   <body>
      <div id="container">
         <a href="http://go.microsoft.com/fwlink/?linkid=66138&amp;clcid=0x409">
            <img src="welcome.png" alt="IIS7" width="571" height="411"/>
         </a>
      </div>
   </body>
</html>

您将获得IIS7“欢迎”页面,实际上并没有使用服务。 因此,您的端点是错误的。 直接针对该服务在SoapUI中重新使用WSDL。 那应该给您一个带有正确端点(包括主机,端口和路径)的请求。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM