Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# SOAPUI-文档不是信封_C#_Web Services_Iis_Soapui - Fatal编程技术网

C# SOAPUI-文档不是信封

C# SOAPUI-文档不是信封,c#,web-services,iis,soapui,C#,Web Services,Iis,Soapui,我有一个用C#编写的简单Web服务。它只需要2个数字,并给出它们的总和。在我的浏览器中进行测试时,它工作得非常好,但是当我将此服务导入SOAPUI并尝试进行测试时,会出现以下错误: 第1行:错误:文档不是信封@:document元素不匹配得到html@ 这是左侧窗口中显示的内容(请求): 您将获得IIS7“欢迎”页面,但实际上并没有点击您的服务。因此,您的端点是错误的。在SoapUI中直接针对服务重新使用WSDL。这将为您提供一个具有正确端点(包括主机、端口和路径)的请求。看起来服务正在返回h

我有一个用C#编写的简单Web服务。它只需要2个数字,并给出它们的总和。在我的浏览器中进行测试时,它工作得非常好,但是当我将此服务导入SOAPUI并尝试进行测试时,会出现以下错误:

第1行:错误:文档不是信封@:document元素不匹配得到html@

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



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

看起来服务正在返回html响应。你确定你有正确的端点吗?你是如何在浏览器中测试它的?
<?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>