]> granicus.if.org Git - php/commitdiff
Cleanup
authorDmitry Stogov <dmitry@php.net>
Fri, 13 Feb 2004 10:29:55 +0000 (10:29 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 13 Feb 2004 10:29:55 +0000 (10:29 +0000)
ext/soap/interop/client_round2_interop.php
ext/soap/interop/client_round2_results.php
ext/soap/interop/index.php
ext/soap/interop/server_round2_groupC.php

index 76fe653e68b836c23b0669026cd58d72bf62fedf..60d144ec7b13e5260420c8a996fa06b25c57fd9e 100644 (file)
@@ -63,9 +63,9 @@ class Interop_Client
 
     function Interop_Client() {
         global $interopConfig;
-               $this->DSN = $interopConfig['DSN'];
-               $this->baseURL = $interopConfig['baseURL'];
-               //$this->baseURL = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
+        $this->DSN = $interopConfig['DSN'];
+        $this->baseURL = $interopConfig['baseURL'];
+        //$this->baseURL = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
         // set up the database connection
         $this->dbc = DB::connect($this->DSN, true);
         // if it errors out, just ignore it and rely on regular methods
@@ -96,10 +96,10 @@ class Interop_Client
         // retreive endpoints from the endpoint server
         $endpointArray = $soapclient->__call("GetEndpointInfo",array("groupName"=>$test),array('soapaction'=>"http://soapinterop.org/",'uri'=>"http://soapinterop.org/"));
         if (is_soap_fault($endpointArray) || PEAR::isError($endpointArray)) {
-                       if ($this->html) print "<pre>";
+            if ($this->html) print "<pre>";
             print $soapclient->wire."\n";
             print_r($endpointArray);
-                       if ($this->html) print "</pre>";
+            if ($this->html) print "</pre>";
             print "\n";
             return;
         }
@@ -152,10 +152,10 @@ class Interop_Client
             }
         } catch (SoapFault $fault) {
             if ($this->html) {
-                           echo "<pre>$fault</pre>\n";
-                       } else {
-                           echo "$fault\n";
-                       }
+                echo "<pre>$fault</pre>\n";
+            } else {
+                echo "$fault\n";
+            }
             return NULL;
         }
         // retreive all endpoints now
@@ -212,13 +212,7 @@ class Interop_Client
         foreach ($db_ep as $entry) {
             $this->endpoints[$entry['endpointName']] = $entry;
         }
-/*
-        $this->endpoints["PHP ext/soap"] =
-          array("endpointName" => "PHP ext/soap",
-                "endpointURL"  => "http://soap.4s4c.com/ilab/soap.asp",
-                "wsdlURL"      => "http://www.pocketsoap.com/services/ilab.wsdl",
-                "class"        => "base" "status"]=> string(1) "1" }
-*/
+
         if (count($this->endpoints) > 0) {
             $this->currentTest = $base;
             return TRUE;
@@ -269,7 +263,7 @@ class Interop_Client
             $success = $result['fault']->faultcode;
             $pos = strpos($success,':');
             if ($pos !== false) {
-               $success = substr($success,$pos+1);                     
+              $success = substr($success,$pos+1);                 
             }
             $error = $result['fault']->faultstring;
             if (!$wire) $wire= $result['fault']->detail;
@@ -347,7 +341,7 @@ class Interop_Client
     */
     function compareResult($expect, $result, $type = NULL)
     {
-       return compare($expect, $result);
+      return compare($expect, $result);
     }
 
 
@@ -433,17 +427,15 @@ try {
             }
             $return = eval('return $soap->'.$soap_test->method_name.'('.$args.');');
         } else {
-               if ($soap_test->headers || $soap_test->headers_expect) {
+          if ($soap_test->headers || $soap_test->headers_expect) {
             $return = $soap->__call($soap_test->method_name,$soap_test->method_params,array('soapaction'=>$soapaction,'uri'=>$namespace), $soap_test->headers, $result_headers);
           } else {
             $return = $soap->__call($soap_test->method_name,$soap_test->method_params,array('soapaction'=>$soapaction,'uri'=>$namespace));
           }
         }
 } catch (SoapFault $ex) {
-       $return = $ex;
+  $return = $ex;
 }
-//var_dump($return);
-
 
         if(!is_soap_fault($return)){
             if ($soap_test->expect !== NULL) {
@@ -460,7 +452,7 @@ try {
             // compare header results
             $headers_ok = TRUE;
             if ($soap_test->headers || $soap_test->headers_expect) {
-                                                       $headers_ok = $this->compareResult($soap_test->headers_expect, $result_headers);                
+              $headers_ok = $this->compareResult($soap_test->headers_expect, $result_headers);              
             }
 
             # we need to decode what we sent so we can compare!
@@ -486,10 +478,10 @@ try {
                     "RESPONSE:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastresponse()))."\n\n".
                     "EXPECTED:\n".var_dump_str($sent_d)."\n".
                     "RESULTL:\n".var_dump_str($return);
-                                               if ($soap_test->headers_expect) {
-                                                       $wire .= "\nEXPECTED HEADERS:\n".var_dump_str($soap_test->headers_expect)."\n".
-                                                                "RESULT HEADERS:\n".var_dump_str($result_headers);
-                                               }
+            if ($soap_test->headers_expect) {
+              $wire .= "\nEXPECTED HEADERS:\n".var_dump_str($soap_test->headers_expect)."\n".
+                       "RESULT HEADERS:\n".var_dump_str($result_headers);
+            }
             #print "Wire:".htmlentities($wire);
 
             if($ok){
@@ -522,7 +514,7 @@ try {
                 $res =$fault->faultcode;
                 $pos = strpos($res,':');
                 if ($pos !== false) {
-                       $res = substr($res,$pos+1);                     
+                  $res = substr($res,$pos+1);                 
                 }
             }
             // save the wire
@@ -565,7 +557,7 @@ try {
             if ($this->show) {
               print "Processing $endpoint at {$endpoint_info['endpointURL']}";
               if ($this->html) print "<br>\n"; else print "\n";
-               }
+            }
 
             foreach($soap_tests[$this->currentTest] as $soap_test) {
             //foreach(array_keys($method_params[$this->currentTest][$this->paramType]) as $method)
@@ -709,12 +701,6 @@ try {
         }
         $this->totals['calls'] = count($methods) * $this->totals['servers'];
 
-#        if ($this->totals['fail'] == $this->totals['calls']) {
-#            // assume tests have not run, skip outputing table
-#            print "No Data Available<br>\n";
-#            return;
-#        }
-
         echo "\n\n<b>Servers: {$this->totals['servers']} Calls: {$this->totals['calls']} Success: {$this->totals['success']} Fail: {$this->totals['fail']}</b><br>\n";
 
         echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n";
index 42c49e2b3904d72072932d30e2b0de2403d8c141..52e89c3ded44c0b736aa8d2c36140537182d78fa 100644 (file)
@@ -41,11 +41,11 @@ TD.WSDLPARSER { background-color: Yellow; }
 TD.HTTP { background-color: Yellow; }
 TD.SMTP { background-color: Yellow; }
 </style>
-       <title>PEAR-PHP SOAP Interop Tests</title>
+  <title>PHP SOAP Client Interop Test Results</title>
 </head>
 
 <body bgcolor="White" text="Black">
-<h2 align="center">SOAP Client Interop Test Results: Round2</h2>
+<h2 align="center">PHP SOAP Client Interop Test Results: Round2</h2>
 
 <a href="index.php">Back to Interop Index</a><br>
 <p>&nbsp;</p>
index 999cd47efa7b671c9f56301121a16b022be44b1c..1ae25d92f02efbef8e58646676694fdc526b8d24 100644 (file)
@@ -2,7 +2,7 @@
 
 <html>
 <head>
-       <title>PEAR SOAP Interop</title>
+  <title>PHP SOAP Interop</title>
 </head>
 <?php
 // get our endpoint
@@ -13,8 +13,8 @@ $groupc = (isset($_SERVER['HTTPS'])?"https://":"http://").$server.dirname($_SERV
 ?>
 <body>
 
-<h2 align='center'>PEAR SOAP Interop</h2>
-<p>Welcome to the PEAR SOAP Interop pages.  These pages are set up for
+<h2 align='center'>PHP SOAP Interop</h2>
+<p>Welcome to the PHP SOAP Interop pages.  These pages are set up for
 SOAP Builder interop tests.  You can find out more about the interop tests
 at <a href="http://www.whitemesa.com/interop.htm">White Mesa</a>.</p>
 <p>Currently Round 2 base, Group B and Group C interop tests are enabled.</p>
@@ -26,32 +26,23 @@ Group C WSDL: <a href="<?php echo $groupc ?>"><?php echo $groupc ?></a><br>
 
 <h3>Interop Client</h3>
 
-<p>
-Notes:
-Tests are done both "Direct" and with "WSDL".  WSDL tests use the supplied interop WSDL
+<p>Notes: Tests are done both "Direct" and with "WSDL".  WSDL tests use the supplied interop WSDL
 to run the tests against.  The Direct method uses an internal prebuilt list of methods and parameters
 for the test.</p>
-<p>
-Tests are also run against two methods of generating method parameters.  The first, 'php', attempts
-to directly serialize PHP variables into soap values.  The second method, 'soapval', uses a SOAP_Value
-class to define what the type of the value is.  The second method is more interopable than the first
-by nature.
-</p>
+<p>Tests are also run against two methods of generating method parameters.  The first, 'php', attempts
+to directly serialize PHP variables into soap values.  The second method, 'soapval', uses a SoapParam and SoapVar
+classes to define what the type of the value is.</p>
 
 <h3>Client Test Interface</h3>
-<p>The <a href="client_round2.php">client interface</a> allows you to run the PEAR SOAP
+<p>The <a href="client_round2.php">client interface</a> allows you to run the PHP SOAP
 Client against a choosen interop server.  Each run updates the results database below.</p>
 
 <h3>Interop Client Test Results</h3>
-<p>This is a database of the current test results using PEAR SOAP Clients against interop servers.</p>
-<p>
-More detail (wire) about errors (marked yellow or red) can be obtained by clicking on the
+<p>This is a database of the current test results using PHP SOAP Clients against interop servers.</p>
+<p>More detail (wire) about errors (marked yellow or red) can be obtained by clicking on the
 link in the result box.  If we have an HTTP error
 attempting to connect to the endpoint, we will mark all consecutive attempts as errors, and skip
-testing that endpoint.  This reduces the time it takes to run the tests if a server is unavailable.
-WSDLCACHE errors mean we cannot retreive the WSDL file specified for the endpoint.
-</p>
-
+testing that endpoint.  This reduces the time it takes to run the tests if a server is unavailable.</p>
 <ul>
 <li><a href="client_round2_results.php?test=base&type=php&wsdl=0">Base results using PHP native types</a></li>
 <li><a href="client_round2_results.php?test=base&type=soapval&wsdl=0">Base results using SOAP types</a></li>
index 539c9f4d6ed8ca20870bc2c6f3b616e50d8e727e..25241d0429e33676335094a5cc74dbb2f1e21229 100644 (file)
@@ -24,15 +24,11 @@ class SOAP_Interop_GroupC {
 
     function echoMeStringRequest($string)
     {
-//        return $string;
-//        return new SoapVar($string, XSD_STRING, "string", XSD_NAMESPACE, "echoMeStringResponse", $this->method_namespace);
         return new SoapHeader($this->method_namespace, "echoMeStringResponse", $string);
     }
 
     function echoMeStructRequest($struct)
     {
-//        return $struct;
-//        return new SoapVar($struct, SOAP_ENC_OBJECT, "SOAPStruct", "http://soapinterop.org/", "echoMeStructResponse",$this->method_namespace);
         return new SoapHeader($this->method_namespace, "echoMeStructResponse", $struct);
     }