Skip to content

Commit

Permalink
several bug fixes as provided by users on soap email list
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/SOAP/trunk@127554 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
Shane Caraveo committed May 18, 2003
1 parent eea12ba commit 3eb51c1
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 22 deletions.
3 changes: 2 additions & 1 deletion Base.php
Expand Up @@ -91,7 +91,8 @@
define('SCHEMA_DISCO_SCL', 'http://schemas.xmlsoap.org/disco/scl/');

define('SCHEMA_SOAP', 'http://schemas.xmlsoap.org/wsdl/soap/');
define('SCHEMA_HTTP', 'http://schemas.xmlsoap.org/wsdl/http/');
define('SCHEMA_SOAP_HTTP', 'http://schemas.xmlsoap.org/soap/http/');
define('SCHEMA_WSDL_HTTP', 'http://schemas.xmlsoap.org/wsdl/http/');
define('SCHEMA_MIME', 'http://schemas.xmlsoap.org/wsdl/mime/');
define('SCHEMA_WSDL', 'http://schemas.xmlsoap.org/wsdl/');
define('SCHEMA_DIME', 'http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/');
Expand Down
16 changes: 3 additions & 13 deletions Client.php
Expand Up @@ -95,13 +95,6 @@ class SOAP_Client extends SOAP_Base
*/
var $__options = array('trace'=>0);

/**
* Available categories when using options
*
* @var array
*/
var $__optionCategories = array('curl');

/**
* encoding
*
Expand Down Expand Up @@ -295,21 +288,18 @@ function &call($method, &$params, $namespace = false, $soapAction = false)
* $soapclient->setopt('curl', CURLOPT_VERBOSE, 1)
* to affect an option when using SSL connections
*
* The category has to be a registered one.
*
* @access public
* @param string $category category to which the option applies
* @param string $option option name
* @param string $value option value
* @return void
* @see SOAP_Client::__optionCategories
*/
function setOpt($category, $option, $value=NULL)
{
if ($value) {
if (in_array($category, $this->__optionCategories)) {
$this->__options[$category][$option] = $value;
}
if (!isset($this->__options[$category]))
$this->__options[$category] = array();
$this->__options[$category][$option] = $value;
} else {
$this->__options[$category] = $option;
}
Expand Down
2 changes: 1 addition & 1 deletion Disco.php
Expand Up @@ -118,7 +118,7 @@ function _generate_WSDL()
$this->_wsdl['definitions']['binding']['attr']['name'] = $this->_bindingname;
$this->_wsdl['definitions']['binding']['attr']['type'] = 'tns:' . $this->_portname;
$this->_wsdl['definitions']['binding']['soap:binding']['attr']['style'] = 'rpc';
$this->_wsdl['definitions']['binding']['soap:binding']['attr']['transport'] = SCHEMA_HTTP;
$this->_wsdl['definitions']['binding']['soap:binding']['attr']['transport'] = SCHEMA_SOAP_HTTP;

# SERVICE
$this->_wsdl['definitions']['service']['attr']['name'] = $this->_service_name . 'Service';
Expand Down
2 changes: 1 addition & 1 deletion Server.php
Expand Up @@ -475,7 +475,7 @@ function verifyMethod($request)

// if we aliased the soap method name to a php function,
// change the call_method so we do the right thing.
if (array_key_exists('alias',$map)) {
if (array_key_exists('alias',$map) && !empty($map['alias'])) {
$this->call_methodname = $map['alias'];
}

Expand Down
2 changes: 1 addition & 1 deletion Server/Email.php
Expand Up @@ -195,7 +195,7 @@ function service(&$data, $endpoint = '', $send_response = TRUE, $dump = FALSE)
$from = array_key_exists('reply-to',$this->headers) ? $this->headers['reply-to']:$this->headers['from'];
# XXX what if no from?????
$soap_transport =& new SOAP_Transport('mailto:'.$from, $this->response_encoding);
$soap_transport =& SOAP_Transport::getTransport('mailto:'.$from, $this->response_encoding);
$from = $this->endpoint ? $this->endpoint : $this->headers['to'];
$headers['In-Reply-To']=$this->headers['message-id'];
$options = array('from' => $from, 'subject'=> $this->headers['subject'], 'headers' => $headers);
Expand Down
4 changes: 2 additions & 2 deletions Server/Email_Gateway.php
Expand Up @@ -75,7 +75,7 @@ function service(&$data, $gateway='', $endpoint = '', $send_response = TRUE, $du

# call the HTTP Server
if (!$response) {
$soap_transport =& new SOAP_Transport($gateway, $this->xml_encoding);
$soap_transport =& SOAP_Transport::getTransport($gateway, $this->xml_encoding);
if ($soap_transport->fault) {
$response = $soap_transport->fault->message();
}
Expand Down Expand Up @@ -129,7 +129,7 @@ function service(&$data, $gateway='', $endpoint = '', $send_response = TRUE, $du
$from = array_key_exists('reply-to',$this->headers) ? $this->headers['reply-to']:$this->headers['from'];
# XXX what if no from?????
$soap_transport =& new SOAP_Transport('mailto:'.$from, $this->response_encoding);
$soap_transport =& SOAP_Transport::getTransport('mailto:'.$from, $this->response_encoding);
$from = $this->endpoint ? $this->endpoint : $this->headers['to'];
$headers = array('In-Reply-To'=>$this->headers['message-id']);
$options = array('from' => $from, 'subject'=> $this->headers['subject'], 'headers' => $headers);
Expand Down
5 changes: 4 additions & 1 deletion Transport/HTTP.php
Expand Up @@ -483,7 +483,10 @@ function &_sendHTTPS(&$msg, $options)
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $options['proxy_user'] . ':' . $options['proxy_pass']);
}

curl_setopt($ch, CURLOPT_HTTPHEADER , array('Content-Type: text/xml;charset=' . $this->encoding, 'SOAPAction: ""'));
if (!isset($options['soapaction'])) {
$options['soapaction'] = '';
}
curl_setopt($ch, CURLOPT_HTTPHEADER , array('Content-Type: text/xml;charset=' . $this->encoding, 'SOAPAction: "'.$options['soapaction'].'"'));
curl_setopt($ch, CURLOPT_USERAGENT , $this->_userAgent);

if ($this->timeout) {
Expand Down
4 changes: 2 additions & 2 deletions WSDL.php
Expand Up @@ -1070,7 +1070,7 @@ function startElement($parser, $name, $attrs) {
break;
}
break;
case SCHEMA_HTTP:
case SCHEMA_WSDL_HTTP:
switch($qname->name) {
case 'binding':
// sect 4.4
Expand Down Expand Up @@ -1165,7 +1165,7 @@ function startElement($parser, $name, $attrs) {
// what TYPE of port is it? SOAP or HTTP?
$ns = $qname->ns?$this->wsdl->namespaces[strtolower($qname->ns)]:SCHEMA_WSDL;
switch($ns) {
case SCHEMA_HTTP:
case SCHEMA_WSDL_HTTP:
$this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['type']='http';
break;
case SCHEMA_SOAP:
Expand Down

0 comments on commit 3eb51c1

Please sign in to comment.