cvs: pecl /soap/interop client_round2_interop.php client_round2_params.php echoheadersvc.wsdl.php index.php interop.wsdl.php server_round2_base.php
server_round2_groupB.php test.utility.php

From: Date: Fri, 09 Jan 2004 14:56:24 +0000
Subject: cvs: pecl /soap/interop client_round2_interop.php client_round2_params.php echoheadersvc.wsdl.php index.php interop.wsdl.php server_round2_base.php
server_round2_groupB.php test.utility.php
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-709@lists.php.net to get a copy of this message
dmitry Fri Jan 9 09:56:24 2004 EDT Modified files: /pecl/soap/interop client_round2_interop.php client_round2_params.php echoheadersvc.wsdl.php index.php interop.wsdl.php server_round2_base.php server_round2_groupB.php test.utility.php Log: Tests were improved (https:// support)

Index: pecl/soap/interop/client_round2_interop.php diff -u pecl/soap/interop/client_round2_interop.php:1.4 pecl/soap/interop/client_round2_interop.php:1.5 --- pecl/soap/interop/client_round2_interop.php:1.4 Mon Jan 5 11:44:00 2004 +++ pecl/soap/interop/client_round2_interop.php Fri Jan 9 09:56:24 2004 @@ -16,7 +16,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: client_round2_interop.php,v 1.4 2004/01/05 16:44:00 dmitry Exp $ +// $Id: client_round2_interop.php,v 1.5 2004/01/09 14:56:24 dmitry Exp $ // require_once 'DB.php'; // PEAR/DB require_once 'client_round2_params.php'; @@ -71,18 +71,18 @@ // set up local endpoint $this->localEndpoint['base'] = (object)array( 'endpointName'=>'PHP ext/soap', - 'endpointURL'=>'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/server_round2_base.php', - 'wsdlURL'=>'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/interop.wsdl.php' + 'endpointURL'=>'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/server_round2_base.php', + 'wsdlURL'=>'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/interop.wsdl.php' ); $this->localEndpoint['GroupB'] = (object)array( 'endpointName'=>'PHP ext/soap', - 'endpointURL'=>'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/server_round2_groupB.php', - 'wsdlURL'=>'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/interopB.wsdl.php' + 'endpointURL'=>'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/server_round2_groupB.php', + 'wsdlURL'=>'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/interopB.wsdl.php' ); $this->localEndpoint['GroupC'] = (object)array( 'endpointName'=>'PHP ext/soap', - 'endpointURL'=>'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/server_round2_groupC.php', - 'wsdlURL'=>'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/echoheadersvc.wsdl.php' + 'endpointURL'=>'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/server_round2_groupC.php', + 'wsdlURL'=>'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/echoheadersvc.wsdl.php' ); } @@ -481,9 +481,14 @@ // compare the results with what we sent - $ok = $this->compareResult($sent_d,$return, $sent->type); - if (!$ok && $soap_test->expect) { + if ($soap_test->cmp_func !== NULL) { + $cmp_func = $soap_test->cmp_func; + $ok = $cmp_func($sent_d,$return); + } else { + $ok = $this->compareResult($sent_d,$return, $sent->type); + if (!$ok && $soap_test->expect) { $ok = $this->compareResult($soap_test->expect,$return); + } } // save the wire Index: pecl/soap/interop/client_round2_params.php diff -u pecl/soap/interop/client_round2_params.php:1.3 pecl/soap/interop/client_round2_params.php:1.4 --- pecl/soap/interop/client_round2_params.php:1.3 Mon Jan 5 11:44:00 2004 +++ pecl/soap/interop/client_round2_params.php Fri Jan 9 09:56:24 2004 @@ -16,7 +16,7 @@ // | Authors: Shane Caraveo <Shane@Caraveo.com> | // +----------------------------------------------------------------------+ // -// $Id: client_round2_params.php,v 1.3 2004/01/05 16:44:00 dmitry Exp $ +// $Id: client_round2_params.php,v 1.4 2004/01/09 14:56:24 dmitry Exp $ // define('SOAP_TEST_ACTOR_NEXT','http://schemas.xmlsoap.org/soap/actor/next'); @@ -27,6 +27,7 @@ var $test_name = NULL; var $method_name = NULL; var $method_params = NULL; + var $cmp_func = NULL; var $expect = NULL; var $expect_fault = FALSE; var $headers = NULL; @@ -36,7 +37,7 @@ var $debug = 0; var $encoding = 'UTF-8'; - function SOAP_Test($methodname, $params, $expect = NULL) { + function SOAP_Test($methodname, $params, $expect = NULL, $cmp_func = NULL) { # XXX we have to do this to make php-soap happy with NULL params if (!$params) $params = array(); @@ -51,6 +52,9 @@ if ($expect !== NULL) { $this->expect = $expect; } + if ($cmp_func !== NULL) { + $this->cmp_func = $cmp_func; + } // determine test type if ($params) { @@ -259,9 +263,9 @@ //*********************************************************** // Base echoHexBinary -$soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => '736F61707834')); +$soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => '736F61707834'),'736F61707834','hex_compare'); $soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => - soap_value('inputHexBinary','736F61707834',XSD_HEXBINARY))); + soap_value('inputHexBinary','736F61707834',XSD_HEXBINARY)),'736F61707834','hex_compare'); //*********************************************************** // Base echoDecimal Index: pecl/soap/interop/echoheadersvc.wsdl.php diff -u pecl/soap/interop/echoheadersvc.wsdl.php:1.1 pecl/soap/interop/echoheadersvc.wsdl.php:1.2 --- pecl/soap/interop/echoheadersvc.wsdl.php:1.1 Mon Jan 5 11:44:00 2004 +++ pecl/soap/interop/echoheadersvc.wsdl.php Fri Jan 9 09:56:24 2004 @@ -12,7 +12,7 @@ <service name="interopLabEchoHeader"> <port name="interopPortEchoHdr" binding="tns:InteropEchoHeaderBinding"> - <soap:address location="http://<?php echo ($_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']));?>/server_round2.php"/> + <soap:address location="<?php echo ((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']));?>/server_round2.php"/> </port> </service> Index: pecl/soap/interop/index.php diff -u pecl/soap/interop/index.php:1.2 pecl/soap/interop/index.php:1.3 --- pecl/soap/interop/index.php:1.2 Mon Jan 5 11:44:00 2004 +++ pecl/soap/interop/index.php Fri Jan 9 09:56:24 2004 @@ -6,10 +6,10 @@ </head> <?php // get our endpoint -$server = $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT']; -$base = 'http://'.$server.dirname($_SERVER['PHP_SELF'])."/interop.wsdl.php"; -$groupb = 'http://'.$server.dirname($_SERVER['PHP_SELF'])."/interopB.wsdl.php"; -$groupc = 'http://'.$server.dirname($_SERVER['PHP_SELF'])."/echoheadersvc.wsdl.php"; +$server = $_SERVER['HTTP_HOST'].':'.$_SERVER['SERVER_PORT']; +$base = (isset($_SERVER['HTTPS'])?"https://":"http://").$server.dirname($_SERVER['PHP_SELF'])."/interop.wsdl.php"; +$groupb = (isset($_SERVER['HTTPS'])?"https://":"http://").$server.dirname($_SERVER['PHP_SELF'])."/interopB.wsdl.php"; +$groupc = (isset($_SERVER['HTTPS'])?"https://":"http://").$server.dirname($_SERVER['PHP_SELF'])."/echoheadersvc.wsdl.php"; ?> <body> Index: pecl/soap/interop/interop.wsdl.php diff -u pecl/soap/interop/interop.wsdl.php:1.1 pecl/soap/interop/interop.wsdl.php:1.2 --- pecl/soap/interop/interop.wsdl.php:1.1 Mon Jan 5 11:44:00 2004 +++ pecl/soap/interop/interop.wsdl.php Fri Jan 9 09:56:24 2004 @@ -328,7 +328,7 @@ <service name="InteropTest"> <port name="InteropTestPort" binding="tns:InteropTestBinding"> - <soap:address location="http://<?php echo ($_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']));?>/server_round2_base.php"/> + <soap:address location="<?php echo ((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']));?>/server_round2_base.php"/> </port> </service> Index: pecl/soap/interop/server_round2_base.php diff -u pecl/soap/interop/server_round2_base.php:1.3 pecl/soap/interop/server_round2_base.php:1.4 --- pecl/soap/interop/server_round2_base.php:1.3 Mon Jan 5 11:44:00 2004 +++ pecl/soap/interop/server_round2_base.php Fri Jan 9 09:56:24 2004 @@ -17,7 +17,7 @@ // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author | // +----------------------------------------------------------------------+ // -// $Id: server_round2_base.php,v 1.3 2004/01/05 16:44:00 dmitry Exp $ +// $Id: server_round2_base.php,v 1.4 2004/01/09 14:56:24 dmitry Exp $ // function generateFault($short, $long) @@ -139,7 +139,7 @@ } $server = new SoapServer("http://test-uri"); -$server->bind("http://".$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF'])."/interop.wsdl.php"); +$server->bind((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interop.wsdl.php"); $server->setClass("SOAP_Interop_Base"); $server->handle(); ?> \ No newline at end of file Index: pecl/soap/interop/server_round2_groupB.php diff -u pecl/soap/interop/server_round2_groupB.php:1.3 pecl/soap/interop/server_round2_groupB.php:1.4 --- pecl/soap/interop/server_round2_groupB.php:1.3 Mon Jan 5 11:44:00 2004 +++ pecl/soap/interop/server_round2_groupB.php Fri Jan 9 09:56:24 2004 @@ -17,7 +17,7 @@ // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author | // +----------------------------------------------------------------------+ // -// $Id: server_round2_groupB.php,v 1.3 2004/01/05 16:44:00 dmitry Exp $ +// $Id: server_round2_groupB.php,v 1.4 2004/01/09 14:56:24 dmitry Exp $ // class SOAP_Interop_GroupB { @@ -64,7 +64,7 @@ } $server = new SoapServer("http://test-uri"); -$server->bind("http://".$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF'])."/interopB.wsdl.php"); +$server->bind((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interopB.wsdl.php"); $server->setClass("SOAP_Interop_GroupB"); $server->handle(); ?> \ No newline at end of file Index: pecl/soap/interop/test.utility.php diff -u pecl/soap/interop/test.utility.php:1.2 pecl/soap/interop/test.utility.php:1.3 --- pecl/soap/interop/test.utility.php:1.2 Mon Jan 5 11:44:00 2004 +++ pecl/soap/interop/test.utility.php Fri Jan 9 09:56:24 2004 @@ -1,5 +1,10 @@ <?php +function hex_compare($f1, $f2) +{ + return strcasecmp($f1,$f2) == 0; +} + function number_compare($f1, $f2) { # figure out which has the least fractional digits
« previous php.pecl.cvs (#709) next »