Changeset 21304 for branches/version-2_11-dev/data/module/SOAP/Server.php
- Timestamp:
- 2011/10/31 13:54:41 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_11-dev/data/module/SOAP/Server.php
r21299 r21304 176 176 /* We'll try to build our endpoint. */ 177 177 $this->endpoint = 'http://' . $_SERVER['SERVER_NAME']; 178 if ( isset($_SERVER['SERVER_PORT'])) {178 if ($_SERVER['SERVER_PORT']) { 179 179 $this->endpoint .= ':' . $_SERVER['SERVER_PORT']; 180 180 } … … 186 186 if (isset($_SERVER['CONTENT_TYPE'])) { 187 187 if (strcasecmp($_SERVER['CONTENT_TYPE'], 'application/dime') == 0) { 188 $this->_decodeDIMEMessage($data, $ this->headers, $attachments);188 $this->_decodeDIMEMessage($data, $headers, $attachments); 189 189 $useEncoding = 'DIME'; 190 190 } elseif (stristr($_SERVER['CONTENT_TYPE'], 'multipart/related')) { … … 193 193 stripslashes($_SERVER['CONTENT_TYPE']) . 194 194 "\r\n\r\n" . $data; 195 $this->_decodeMimeMessage($data, $ this->headers, $attachments);195 $this->_decodeMimeMessage($data, $headers, $attachments); 196 196 $useEncoding = 'Mime'; 197 197 } 198 if (!isset($ this->headers['content-type'])) {199 $ this->headers['content-type'] = stripslashes($_SERVER['CONTENT_TYPE']);198 if (!isset($headers['content-type'])) { 199 $headers['content-type'] = stripslashes($_SERVER['CONTENT_TYPE']); 200 200 } 201 201 if (!$this->fault && 202 !$this->_getContentEncoding($ this->headers['content-type'])) {202 !$this->_getContentEncoding($headers['content-type'])) { 203 203 $this->xml_encoding = SOAP_DEFAULT_ENCODING; 204 204 /* Found encoding we don't understand; return a fault. */ … … 210 210 * WSDL file. */ 211 211 if (!$this->fault && !$test && 212 ((isset($_SERVER['REQUEST_METHOD']) && 213 $_SERVER['REQUEST_METHOD'] != 'POST') || 214 (isset($this->headers['content-type']) && 215 strncmp($this->headers['content-type'], 'text/xml', 8) != 0))) { 212 ($_SERVER['REQUEST_METHOD'] != 'POST' || 213 strncmp($headers['content-type'], 'text/xml', 8) != 0)) { 216 214 /* This is not possibly a valid SOAP request, try to return a WSDL 217 215 * file. */ 218 $got = isset($this->headers['content-type']) ? $this->headers['content-type'] : 'Nothing!'; 219 $this->_raiseSoapFault('Invalid SOAP request, must be POST with content-type: text/xml, got: ' . $got, '', '', 'Server'); 216 $this->_raiseSoapFault('Invalid SOAP request, must be POST with content-type: text/xml, got: ' . (isset($headers['content-type']) ? $headers['content-type'] : 'Nothing!'), '', '', 'Server'); 220 217 } 221 218 … … 383 380 { 384 381 /* Parse response, get SOAP_Parser object. */ 385 $parser = new SOAP_Parser($data, $this->xml_encoding, $attachments);386 382 $parser =& new SOAP_Parser($data, $this->xml_encoding, $attachments); 383 /* If fault occurred during message parsing. */ 387 384 if ($parser->fault) { 388 /* Fault occurred during message parsing. */389 385 $this->fault = $parser->fault; 390 return null;391 }392 if (!count($parser->root_struct_name)) {393 /* No method specified. */394 $this->_raiseSoapFault('No method specified in request.');395 386 return null; 396 387 } … … 553 544 if (is_array($requestArray)) { 554 545 if (isset($requestArray['faultcode']) || 555 isset($requestArray[ SOAP_BASE::SOAPENVPrefix().':faultcode'])) {546 isset($requestArray['SOAP-ENV:faultcode'])) { 556 547 $faultcode = $faultstring = $faultdetail = $faultactor = ''; 557 548 foreach ($requestArray as $k => $v) { … … 809 800 * @return void 810 801 */ 811 function addObjectWSDL( $wsdl_obj, $targetNamespace, $service_name,802 function addObjectWSDL(&$wsdl_obj, $targetNamespace, $service_name, 812 803 $service_desc = '') 813 804 {
Note: See TracChangeset
for help on using the changeset viewer.