Test MSE with SoapUI

Jul 1, 2008 at 9:47 AM
When i tested the service hosted in MSE with SoapUI, the response message is a bunch of HTML Text instead of Soap Response.

Please advice?

Thanks.
Developer
Jul 1, 2008 at 4:38 PM

Can you elaborate on your experience?  I used SoapUI to call the AddIntegers operation hosted in the MSE that invokes the Basic Calculator service.  The following is the response (Raw view)

HTTP/1.1 200 OK
Date: Tue, 01 Jul 2008 15:31:16 GMT
Content-Length: 227
Content-Type: application/soap+xml; charset=utf-8
Server: Microsoft-HTTPAPI/2.0

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Body><AddIntegersResponse xmlns="http://mse.testservices.com/wcf/calculator"><AddIntegersResult>55</AddIntegersResult></AddIntegersResponse></s:Body></s:Envelope>

Are you experiencing or expecting something different?

Thanks.


tatsean wrote:
When i tested the service hosted in MSE with SoapUI, the response message is a bunch of HTML Text instead of Soap Response.

Please advice?

Thanks.



Jul 2, 2008 at 1:31 AM
Edited Jul 2, 2008 at 1:38 AM
I afraid not. The following is the result i got. I may have missed out something?

What i tried to do is follow the "Introduction" exercise in the lab folder. After that, i went to SoapUI to create a "new WSDL Project", in the entry that requires me to key in the WSDL path, i used "http://localhost:9300/myService?wsdl". Then, i double click on the "Request" entry (in SoapUI) to pop up a windows that allows me to modify the default Soap Request Message.

Thanks

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html dir=ltr>

<head>
<style>
a:link            {font:8pt/11pt verdana; color:FF0000}
a:visited        {font:8pt/11pt verdana; color:#4e4e4e}
</style>

<META NAME="ROBOTS" CONTENT="NOINDEX">

<title>The page cannot be displayed</title>

<META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
</head>

<script>
function Homepage(){
<!--
// in real bits, urls get returned to our script like this:
// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm

    //For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
    DocURL=document.URL;
   
    //this is where the http or https will be, as found by searching for :// but skipping the res://
    protocolIndex=DocURL.indexOf("://",4);
   
    //this finds the ending slash for the domain server
    serverIndex=DocURL.indexOf("/",protocolIndex + 3);

    //for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
    //of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
    //urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
    BeginURL=DocURL.indexOf("#",1) + 1;
    urlresult=DocURL.substring(BeginURL,serverIndex);
       
    //for display, we need to skip after http://, and go to the next slash
    displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);
    InsertElementAnchor(urlresult, displayresult);
}

function HtmlEncode(text)
{
    return text.replace(/&/g, '&amp').replace(/'/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}

function TagAttrib(name, value)
{
    return ' '+name+'="'+HtmlEncode(value)+'"';
}

function PrintTag(tagName, needCloseTag, attrib, inner){
    document.write( '<' + tagName + attrib + '>' + HtmlEncode(inner) );
    if (needCloseTag) document.write( '</' + tagName +'>' );
}

function URI(href)
{
    IEVer = window.navigator.appVersion;
    IEVer = IEVer.substr( IEVer.indexOf('MSIE') + 5, 3 );

    return (IEVer.charAt(1)=='.' && IEVer >= '5.5') ?
        encodeURI(href) :
        escape(href).replace(/%3A/g, ':').replace(/%3B/g, ';');
}

function InsertElementAnchor(href, text)
{
    PrintTag('A', true, TagAttrib('HREF', URI(href)), text);
}

//-->
</script>

<body bgcolor="FFFFFF">

<table width="410" cellpadding="3" cellspacing="5">

  <tr>  
    <td align="left" valign="middle" width="360">
    <h1 style="COLOR:000000; FONT: 13pt/15pt verdana"><!--Problem-->The page cannot be displayed</h1>
    </td>
  </tr>
 
  <tr>
    <td width="400" colspan="2">
    <font style="COLOR:000000; FONT: 8pt/11pt verdana">The page you are looking for cannot be displayed because the page address is incorrect.</font> </td>
  </tr>
 
  <tr>
    <td width="400" colspan="2">
    <font style="COLOR:000000; FONT: 8pt/11pt verdana">

    <hr color="#C0C0C0" noshade>
   
    <p>Please try the following:</p>

    <ul>
      <li>If you typed the page address in the Address bar, check that it is entered correctly.<br>
      </li>
     
       <li>Open the
      
       <script>
       <!--
       if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (window.navigator.appVersion.charAt(0) == "2")))
       {
            Homepage();
       }
       //-->
       </script>

       home page and then look for links to the information you want.</li>
    </ul>
   
    <h2 style="COLOR:000000; FONT: 8pt/11pt verdana">HTTP 405 - Resource not
    allowed<br>
    Internet Information Services</h2>
   
    <hr color="#C0C0C0" noshade>
   
    <p>Technical Information (for support personnel)</p>
   
<ul>
<li>More information:<br>
<a href="http://www.microsoft.com/ContentRedirect.asp?prd=iis&sbp=&pver=5.0&pid=&ID=405&cat=web&os=&over=&hrd=&Opt1=&Opt2=&Opt3=" target="_blank">Microsoft Support</a>
</li>
</ul>

    </font></td>
  </tr>
 
</table>
</body>
</html>

Developer
Jul 2, 2008 at 2:26 AM
Ok, the error you are getting is because the URL is incorrect.  There isn't anything listening on that URL. 

If you've successfully gone through the lab to setup the endpoint, then you would be using http://localhost:9200/myService?wsdl

The actual calculator service implementation hangs off of Port 9300 (http://localhost:9300/CalculatorWCF/Calculator?wsdl).



tatsean wrote:
I afraid not. The following is the result i got. I may have missed out something?

What i tried to do is follow the "Introduction" exercise in the lab folder. After that, i went to SoapUI to create a "new WSDL Project", in the entry that requires me to key in the WSDL path, i used "http://localhost:9300/myService?wsdl". Then, i double click on the "Request" entry (in SoapUI) to pop up a windows that allows me to modify the default Soap Request Message.

Thanks

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html dir=ltr>

<head>
<style>
a:link            {font:8pt/11pt verdana; color:FF0000}
a:visited        {font:8pt/11pt verdana; color:#4e4e4e}
</style>

<META NAME="ROBOTS" CONTENT="NOINDEX">

<title>The page cannot be displayed</title>

<META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
</head>

<script>
function Homepage(){
<!--
// in real bits, urls get returned to our script like this:
// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm

    //For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
    DocURL=document.URL;
   
    //this is where the http or https will be, as found by searching for :// but skipping the res://
    protocolIndex=DocURL.indexOf("://",4);
   
    //this finds the ending slash for the domain server
    serverIndex=DocURL.indexOf("/",protocolIndex + 3);

    //for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
    //of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
    //urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
    BeginURL=DocURL.indexOf("#",1) + 1;
    urlresult=DocURL.substring(BeginURL,serverIndex);
       
    //for display, we need to skip after http://, and go to the next slash
    displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);
    InsertElementAnchor(urlresult, displayresult);
}

function HtmlEncode(text)
{
    return text.replace(/&/g, '&amp').replace(/'/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}

function TagAttrib(name, value)
{
    return ' '+name+'="'+HtmlEncode(value)+'"';
}

function PrintTag(tagName, needCloseTag, attrib, inner){
    document.write( '<' + tagName + attrib + '>' + HtmlEncode(inner) );
    if (needCloseTag) document.write( '</' + tagName +'>' );
}

function URI(href)
{
    IEVer = window.navigator.appVersion;
    IEVer = IEVer.substr( IEVer.indexOf('MSIE') + 5, 3 );

    return (IEVer.charAt(1)=='.' && IEVer >= '5.5') ?
        encodeURI(href) :
        escape(href).replace(/%3A/g, ':').replace(/%3B/g, ';');
}

function InsertElementAnchor(href, text)
{
    PrintTag('A', true, TagAttrib('HREF', URI(href)), text);
}

//-->
</script>

<body bgcolor="FFFFFF">

<table width="410" cellpadding="3" cellspacing="5">

  <tr>  
    <td align="left" valign="middle" width="360">
    <h1 style="COLOR:000000; FONT: 13pt/15pt verdana"><!--Problem-->The page cannot be displayed</h1>
    </td>
  </tr>
 
  <tr>
    <td width="400" colspan="2">
    <font style="COLOR:000000; FONT: 8pt/11pt verdana">The page you are looking for cannot be displayed because the page address is incorrect.</font> </td>
  </tr>
 
  <tr>
    <td width="400" colspan="2">
    <font style="COLOR:000000; FONT: 8pt/11pt verdana">

    <hr color="#C0C0C0" noshade>
   
    <p>Please try the following:</p>

    <ul>
      <li>If you typed the page address in the Address bar, check that it is entered correctly.<br>
      </li>
     
       <li>Open the
      
       <script>
       <!--
       if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (window.navigator.appVersion.charAt(0) == "2")))
       {
            Homepage();
       }
       //-->
       </script>

       home page and then look for links to the information you want.</li>
    </ul>
   
    <h2 style="COLOR:000000; FONT: 8pt/11pt verdana">HTTP 405 - Resource not
    allowed<br>
    Internet Information Services</h2>
   
    <hr color="#C0C0C0" noshade>
   
    <p>Technical Information (for support personnel)</p>
   
<ul>
<li>More information:<br>
<a href="http://www.microsoft.com/ContentRedirect.asp?prd=iis&sbp=&pver=5.0&pid=&ID=405&cat=web&os=&over=&hrd=&Opt1=&Opt2=&Opt3=" target="_blank">Microsoft Support</a>
</li>
</ul>

    </font></td>
  </tr>
 
</table>
</body>
</html>




Jul 2, 2008 at 6:51 AM
Edited Jul 2, 2008 at 7:26 AM
Thanks for the previous answer and i am still no luck to solve it. Still the same error.

However, i have a couple of weird questions to ask you.

For the "Host Name", i used PC Name. When i went to SoapUI and key in my WSDL URL, it throws error ("com.eviware.soapui.support.SoapUIException") when i used the value "http://wappsol_tatsean:9200/myService?wsdl". However, if i used "http://localhost:9200/myService?wsdl", I can only add the "New WSDL Project" successfully. However, when i tried the "AddIntegers", it still shows the same error.

In case you want to see the Soap Request in SoapUI:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:cal="http://mse.testservices.com/wcf/calculator">
   <soap:Header/>
   <soap:Body>
      <cal:AddIntegers>
         <!--Optional:-->
         <cal:x>3</cal:x>
         <!--Optional:-->
         <cal:y>4</cal:y>
      </cal:AddIntegers>
   </soap:Body>
</soap:Envelope>

There is another similar question. In MSE, when i tried to use IP or "localhost" as "Host Name", it always throws error when i restart the MSE Runtime Service. It seems that it does not allow me to configure "Host Name" with other value besides "PC Name"? I asked this because if let say i save the WSDL file separately in local drive and change the following content in WSDL file to "localhost" (initially it was "machine name").
<soap12:address location="http://localhost:9800/myService"/></wsdl:port>

After that, i connected to the local-drive-saved WSDL file from SoapUI, and it can run successfully!

Thanks
Developer
Jul 2, 2008 at 8:00 PM

I'd like to confirm you've done the full introduction lab successfully using the Service Tester that ships with the MSE.  If you haven't done so, please go through that lab using the Service Tester rather than SoapUI.
There shouldn't be an issue with using localhost or your ip address in the host name field.  I have successfully used both.

Let us know the results of using the Service Tester to invoke the AddIntegers operation.  (make sure the Basic/Advanced Calculator services are running).  Then we can figure out how to proceed.
Thanks.


tatsean wrote:
Thanks for the previous answer and i am still no luck to solve it. Still the same error.

However, i have a couple of weird questions to ask you.

For the "Host Name", i used PC Name. When i went to SoapUI and key in my WSDL URL, it throws error ("com.eviware.soapui.support.SoapUIException") when i used the value "http://wappsol_tatsean:9200/myService?wsdl". However, if i used "http://localhost:9200/myService?wsdl", I can only add the "New WSDL Project" successfully. However, when i tried the "AddIntegers", it still shows the same error.

In case you want to see the Soap Request in SoapUI:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:cal="http://mse.testservices.com/wcf/calculator">
   <soap:Header/>
   <soap:Body>
      <cal:AddIntegers>
         <!--Optional:-->
         <cal:x>3</cal:x>
         <!--Optional:-->
         <cal:y>4</cal:y>
      </cal:AddIntegers>
   </soap:Body>
</soap:Envelope>

There is another similar question. In MSE, when i tried to use IP or "localhost" as "Host Name", it always throws error when i restart the MSE Runtime Service. It seems that it does not allow me to configure "Host Name" with other value besides "PC Name"? I asked this because if let say i save the WSDL file separately in local drive and change the following content in WSDL file to "localhost" (initially it was "machine name").
<soap12:address location="http://localhost:9800/myService"/></wsdl:port>

After that, i connected to the local-drive-saved WSDL file from SoapUI, and it can run successfully!

Thanks



Jul 7, 2008 at 7:59 AM
I have retried the Introduction lab following the manual. When i tested it using "Service Tester", it works successfully. Then, i created a console application and used "Add Web Reference" to add "http://wappsol_tatsean:9200/myService?wsdl" in order to generate proxy code, and i tested the service from the console application, It also works perfectly well.

However, now, when i tried to add "New WSDL Project" using "http://wappsol_tatsean:9200/myService?wsdl" in SoapUI, an window pop up showing error "com.eviware.soapui.support.SoapUIException: Error Importing wsdl". When i checked the SoapUI console message, it shows the following error details:

14:15:06,343 ERROR [SoapUI] An error occured [Error importing wsdl], see error log for details
14:33:42,546 DEBUG [WsdlLoader] Getting wsdl component from [http://wappsol_tatsean:9200/myService?wsdl]
14:33:42,562 ERROR [WsdlLoader] Failed to load url [http://wappsol_tatsean:9200/myService?wsdl]
14:33:42,562 ERROR [WsdlContext] Loading of definition failed for [http://wappsol_tatsean:9200/myService?wsdl]; org.apache.xmlbeans.XmlException: error: Unexpected element: TAG_END
14:33:42,562 ERROR [SoapUI] An error occured [error: Unexpected element: TAG_END], see error log for details
14:33:42,609 ERROR [WsdlProject] Error importing wsdl: org.apache.xmlbeans.XmlException: error: Unexpected element: TAG_END
       :
       :


Developer
Jul 14, 2008 at 10:31 PM

While I'm not sure what the issue is here, we do appreciate understanding experiences users are having with a variety of tools.  SoapUI worked ok on my machine, so it's likely something about your machine (name? configuration?) is causing a problem with this tool when interpreting the WSDL.  We are looking into revisiting and improving how we generate WSDL for the endpoints hosted by the MSE and will keep this in mind as we test the new solution.

Thanks.


tatsean wrote:
I have retried the Introduction lab following the manual. When i tested it using "Service Tester", it works successfully. Then, i created a console application and used "Add Web Reference" to add "http://wappsol_tatsean:9200/myService?wsdl" in order to generate proxy code, and i tested the service from the console application, It also works perfectly well.

However, now, when i tried to add "New WSDL Project" using "http://wappsol_tatsean:9200/myService?wsdl" in SoapUI, an window pop up showing error "com.eviware.soapui.support.SoapUIException: Error Importing wsdl". When i checked the SoapUI console message, it shows the following error details:

14:15:06,343 ERROR [SoapUI] An error occured [Error importing wsdl], see error log for details
14:33:42,546 DEBUG [WsdlLoader] Getting wsdl component from [http://wappsol_tatsean:9200/myService?wsdl]
14:33:42,562 ERROR [WsdlLoader] Failed to load url [http://wappsol_tatsean:9200/myService?wsdl]
14:33:42,562 ERROR [WsdlContext] Loading of definition failed for [http://wappsol_tatsean:9200/myService?wsdl]; org.apache.xmlbeans.XmlException: error: Unexpected element: TAG_END
14:33:42,562 ERROR [SoapUI] An error occured [error: Unexpected element: TAG_END], see error log for details
14:33:42,609 ERROR [WsdlProject] Error importing wsdl: org.apache.xmlbeans.XmlException: error: Unexpected element: TAG_END
       :
       :