home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _D2BE80A60F204A408F724E2845CADB44 < prev    next >
Encoding:
Text File  |  2002-08-29  |  8.5 KB  |  207 lines

  1. <html>
  2.    <head>
  3.     <title>
  4.             Web Service SOAP Debugger Example Client
  5.     </title>
  6.     <style type="text/css" media="screen">
  7.             body{
  8.                background-color:#FFFFFF;
  9.             }
  10.             #clock{
  11.                position:absolute;
  12.                top:300;
  13.                left:350;
  14.                height:100;
  15.                width:100;
  16.                   font-weight:bold;
  17.                   font-size:12pt;
  18.                   font-family:tahoma;
  19.                   background-color:#3366cc;
  20.                   border: black solid 2px;
  21.                   text-align:center;
  22.             }
  23.  
  24.                  #radiogroup{
  25.                position:absolute;
  26.                top:300;
  27.                left:10;
  28.                  font-family:tahoma;
  29.                  width:350;  
  30.                  }            
  31.             
  32.             #service{
  33.                   behavior:url(webservice.htc) 
  34.             }
  35.  
  36.                  #exampleText{
  37.                      position:absolute;
  38.                      top:10;
  39.                      left:10;
  40.                   font-size:10pt;
  41.                   font-family:tahoma;
  42.                   width:600;
  43.                  }            
  44.             #firstExampleText{
  45.                      position:absolute;
  46.                      top:100;
  47.                      left:10;
  48.                   font-size:10pt;
  49.                   font-family:tahoma;
  50.             }
  51.             
  52.             #debugMode{
  53.                position:absolute;
  54.                top:355;
  55.                left:350;
  56.                height:100;
  57.                width:100;
  58.                   font-weight:bold;
  59.                   font-family:tahoma;
  60.                   text-align:center;
  61.                   display:none;
  62.             }
  63.             
  64.             
  65.             
  66.             
  67.     </style>
  68.         <script type="text/javascript">
  69.         <!--
  70.          var server='www.nanonull.com';
  71.          var debugserver="localhost"
  72.            var  port='80'
  73.            var debugPort='8080';
  74.          var debug=false;
  75.          var started=false;
  76.          var iCallReference=0;
  77.          var initialize=false;
  78.          var msSERVICE_URI='http://'+server+':'+port+'/TimeService/TimeService.asmx?WSDL';
  79.          var msCurrentTimeZone='EST';
  80.          var gs_UNKOWNSERVERERROR='The server was not avaiable';
  81.          var gs_UNKOWNSERVERDEBUGERROR='The SOAP Client could not find the XML Spy SOAP Debugger.\n'+
  82.                                                                                   'Please make sure the Debugging Server and Debugging Port are correct.\n '+
  83.                                                                                   'You may also want to ensure the SOAP Debugger Session has been started. \n '+
  84.                                                                                   'The Debugging Mode is now being turned off automatically!';
  85.            function executeService(){
  86.                if(debug){
  87.                        msSERVICE_URI='http://'+debugserver+':'+debugPort+'/TimeService/TimeService.asmx?WSDL'
  88.                        service.useService(msSERVICE_URI,'MyDebugTimeService');
  89.                        debuginit=true;
  90.                        iCallReference = service.MyDebugTimeService.callService('getTimeZoneTime',msCurrentTimeZone);
  91.                }else{
  92.                        msSERVICE_URI='http://'+server+':'+port+'/TimeService/TimeService.asmx?WSDL';
  93.                        service.useService(msSERVICE_URI,'MyTimeService');
  94.                        iCallReference = service.MyTimeService.callService('getTimeZoneTime',msCurrentTimeZone);
  95.                }
  96.              }    
  97.  
  98.              function onWSresult(){
  99.                   if((event.result.error)&&(iCallReference==event.result.id)){
  100.                      // Pull the error information from the event.result.errorDetail properties
  101.                      var ErrCode   = event.result.errorDetail.code;
  102.                      var ErrString = event.result.errorDetail.string;
  103.                      var xSoap   = event.result.errorDetail.raw;
  104.                      if(debug){
  105.                            alert(ErrString+ '\n'+gs_UNKOWNSERVERDEBUGERROR);
  106.                            setDebugMode(false);
  107.                            window.setTimeout('executeService()',5000,'javascript');
  108.                        }else{
  109.                            alert(ErrString);
  110.                       }     
  111.                  }else if((!event.result.error) && (iCallReference == event.result.id)){
  112.                           updateClock(event.result.value);
  113.                  }else{
  114.                         window.setTimeout('executeService()',5000,'javascript');
  115.                  }
  116.              }
  117.  
  118.              function updateClock(sTime){
  119.                  var scolor='#3366cc';
  120.                  if(sTime=='Unknown Time zone'){
  121.                      scolor='#cc0000';     
  122.                 }
  123.                var oClockElem= document.getElementById('clock');
  124.                oClockElem.innerHTML=sTime;
  125.                oClockElem.style.backgroundColor=scolor;
  126.                window.setTimeout('executeService()',5000,'javascript');
  127.             }
  128.              
  129.             function changeZones(){
  130.                 if (timezone[0].checked)
  131.                       msCurrentTimeZone='EST';
  132.                else if (timezone[1].checked)
  133.                       msCurrentTimeZone='CST';
  134.                else if(timezone[2].checked)
  135.                       msCurrentTimeZone='MST';
  136.                else if(timezone[3].checked)
  137.                       msCurrentTimeZone='PST';
  138.                else if(timezone[4].checked)
  139.                       msCurrentTimeZone='CET';
  140.                else if(timezone[5].checked)
  141.                       msCurrentTimeZone='GMD';
  142.             } 
  143.  
  144.             function setDebugMode(bMode){
  145.                var oPortElem=document.getElementById("serverport");
  146.                var oDebugMode=document.getElementById("debugMode");
  147.                var oDebugServer=document.getElementById("servername");
  148.                debugserver=oDebugServer.value;
  149.                debugPort=oPortElem.value;
  150.                debug=bMode;
  151.                if(debug){
  152.                     oDebugMode.style.display='block';
  153.                }else{
  154.                     oDebugMode.style.display='none';
  155.                }
  156.             }
  157.          // -->         
  158.     </script>
  159.     </head>
  160.     <body onload="executeService()">
  161.       <div id="service" onresult="onWSresult()"/>
  162.         <div id="clock" ></div>
  163.         <div id="debugMode">DEBUG ON</div>
  164.       <div id="ExampleText">
  165.                         <strong>  Welcome To the XML Spy SOAP Debugger Example Client.</strong><br/><br/>
  166. <div>  The  Example uses the<strong> getTimeZoneTime</strong> operation from the <a href="http://www.nanonull.com" target="_blank">NanoNull</a> Time Web Service which is described by the following WSDL file:<br/>
  167.              <a href="http://www.nanonull.com/TimeService/TimeService.asmx?WSDL" target="_blank">         http://www.nanonull.com/TimeService/TimeService.asmx?WSDL</a><br/><br/>
  168. </div>
  169.      <div>To learn more about the operations of this example Time Web Service, view the .NET description available at<br/>
  170.              <a href="http://www.nanonull.com/TimeService/TimeService.asmx" target="_blank">         http://www.nanonull.com/TimeService/TimeService.asmx</a><br/><br/></div>
  171. <div>To learn more about the XML Spy SOAP Debugger, please visit the XML Spy online help, where you can find the complete documentation on how to use this example to experiment with the SOAP Debugger.<br/><br/></div>
  172. <div>This example client automatically queries the Time Web Service every 5 seconds to request the time for the selected timezone:<br/></div>
  173.        </div>
  174.  
  175.         
  176.      <div id="radiogroup" onclick="changeZones()">
  177.  
  178.  
  179.  
  180.              <input type="radio" name="timezone"  checked="checked"/>Eastern Standard Time (US & Canada)<br/>
  181.              <input type="radio" name="timezone"/>Central Standard Time (US & Canada)<br/>
  182.              <input type="radio" name="timezone"/>Mountain Standard Time (US & Canada)<br/>
  183.              <input type="radio" name="timezone"/>Pacific Standard Time (US & Canada)<br/>
  184.              <input type="radio" name="timezone"/>Central European Time <br/>
  185.              <input type="radio" name="timezone"/>GMT (Greenwich Mean Time, UTC)<br/>
  186.              <br/>
  187.              <br/>
  188.              <table>
  189.                  <tr>
  190.                    <td>Debugging Server:</td>
  191.                    <td><input id="servername" value="localhost"/></td>
  192.                 </tr>
  193.                 <tr>
  194.                    <td>Debugging Port :</td>
  195.                    <td><input id="serverport" value="8080" /></td>
  196.                 </tr>
  197.              </table>
  198.              <br/>
  199.                <button onclick="setDebugMode(true)"> Turn On  Debugging  Mode</button>
  200.                <button onclick="setDebugMode(false)"> Turn Off Debugging Mode</button>
  201.  
  202.                
  203.         </div>
  204.      
  205.     </body>
  206. </html>
  207.