Pregunta

I have a simple webservice that i wrote in C#.It just takes 2 numbers and gives you the sum of them.When testing this in my browser it works perfectly, however when I imported this service into SOAPUI and try to test it it gives me the following error :

line -1: error: The document is not a Envelope@http://www.w3.org/2003/05/soap-envelope: document element mismatch got html@http://www.w3.org/1999/xhtml

This is what appears in the left window (Request):

<?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>

This is what appears in the right window (Response):

    <!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>
¿Fue útil?

Solución

You are getting the IIS7 "welcome" page, you're not actually hitting your service. So your endpoint is wrong. Re-consume the WSDL in SoapUI, directly against the service. That should give you a request with the correct endpoint (including host, port, and path).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top