[英]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&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.