PEAR SOAP and SSL Problem

From: Date: Thu, 04 Mar 2004 15:52:05 +0000
Subject: PEAR SOAP and SSL Problem
Groups: php.soap 
Request: Send a blank email to php-soap+get-1401@lists.php.net to get a copy of this message
Greetings, I am trying to attach to a .NET Web Service via SSL. I can and parse to non-SSL services without incident. I've read every bit of documentation that I can find the last few days, where everyone says its possible. My problem is that CURL connection, but it drops an empty request, so the WS fails, as its looking for an XML payload that never comes. The code that I'm using: //--------------------------------------------------------------------
         require_once "SOAP/Client.php";
         $ClientCode = "ClientCode";
         $UserID = "UserID";
         $UserPassword = "password";
         $params = array('ClientCode'=>$ClientCode,
                                                    'UserID'=>$UserID,
                 'UserPassword'=>$UserPassword);
         $client = new SOAP_Client(
             "https://secure.someservice.net/Service/Service.asmx"
             );
         // CURL options to bypass SSL certificate checking
         $client->setOpt('curl', CURLOPT_VERBOSE, 1);
         $client->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0);
       $client->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0);
         $response = $client->call('SystemValidate',$params, array(
                                    'style' => 'literal',
                                    'namespace'=> 'urn:SystemValidate',
                                    'soapaction' =>
'https://secure.someservice.net/Service/SystemValidate',
                                    'use' => 'literal',
                                    'trace'=>'1'));
         if (strtolower(get_class($response)) == "soap_fault") {
               print "Error! " . $response->message;
            } else {
               print "{". print_r($response) ."}";
            }
         print "<hr />Debug<pre>";
// show me the Request Payload print "<p>REQ:<br>";
         print nl2br(htmlspecialchars($client->__getlastrequest()));
         print "</pre>";
         print "<hr /><pre>";
         // show me the response
         print "<p>RES:<br>";
         print nl2br(htmlspecialchars($client->__getlastresponse()));
         print "</pre>";
//-------------------------------------------------------------------------------- In the end I get an empty request payload. I read everything about SSL certificate checking, and placed the right code to bypass that. I'm stumped, so any help will be appreciated. Regards, Richard Rosa

« previous php.soap (#1401) next »