## soap_transport_http

Description

transport class for sending/receiving data via HTTP and HTTPS NOTE: PHP must be compiled with the CURL extension for HTTPS support

- access: public
- version: $Id: soap_transport_http.html,v 1.2 2010/04/26 20:25:21 snichol Exp $
- author: Dietrich Ayala <dietrich@ganx4.com>
- author: Scott Nichol <snichol@users.sourceforge.net>

Located in /nusoap.php (line 2168)

    nusoap_base
       |
       --soap_transport_http

Variable Summary
mixed $authtype
mixed $certRequest
mixed $ch
mixed $ch_options
mixed $digestRequest
mixed $digest_uri
mixed $encoding
mixed $host
mixed $incoming_cookies
mixed $incoming_headers
mixed $incoming_payload
mixed $outgoing_headers
mixed $outgoing_payload
mixed $password
mixed $path
mixed $persistentConnection
mixed $port
mixed $protocol_version
mixed $proxy
mixed $request_method
mixed $response_status_line
mixed $scheme
mixed $uri
mixed $url
mixed $username
mixed $useSOAPAction
mixed $use_curl
Method Summary
soap_transport_http soap_transport_http (string $url, [array $curl_options = NULL], [boolean $use_curl = false])
void buildPayload (string $data, [string $cookie_str = ''])
boolean connect (mixed $connection_timeout, [integer $response_timeout = 30], integer $timeout)
string decodeChunked (string $buffer, string $lb)
string getCookiesForRequest (array $cookies, [boolean $secure = false])
string getResponse ()
string io_method ()
boolean isSkippableCurlHeader (string &$data)
array parseCookie (string $cookie_str)
string send (string $data, integer $timeout, [integer $response_timeout = 30], [array $cookies = NULL])
string sendHTTPS (string $data, integer $timeout, [integer $response_timeout = 30], array $cookies)
boolean sendRequest (string $data, [array $cookies = NULL])
void setContentType (string $type, [mixed $charset = false])
void setCredentials (string $username, string $password, [string $authtype = 'basic'], [array $digestRequest = array()], [array $certRequest = array()])
void setCurlOption (mixed $option, mixed $value)
void setEncoding ([string $enc = 'gzip, deflate'])
void setHeader (string $name, string $value)
void setProxy (string $proxyhost, string $proxyport, [string $proxyusername = ''], [string $proxypassword = ''], [string $proxyauthtype = 'basic'])
void setSOAPAction (string $soapaction)
void setURL (string $url)
void unsetHeader (string $name)
boolean usePersistentConnection ()
Variables
mixed $authtype = '' (line 2194)
mixed $certRequest = array() (line 2196)
mixed $ch = false (line 2188)
mixed $ch_options = array() (line 2189)
mixed $digestRequest = array() (line 2195)
mixed $digest_uri = '' (line 2172)
mixed $encoding = '' (line 2179)
mixed $host = '' (line 2174)
mixed $incoming_cookies = array() (line 2182)
mixed $incoming_headers = array() (line 2181)
mixed $incoming_payload = '' (line 2184)
mixed $outgoing_headers = array() (line 2180)
mixed $outgoing_payload = '' (line 2183)
mixed $password = '' (line 2193)
mixed $path = '' (line 2176)
mixed $persistentConnection = false (line 2187)
mixed $port = '' (line 2175)
mixed $protocol_version = '1.0' (line 2178)
mixed $proxy = null (line 2191)
mixed $request_method = 'POST' (line 2177)
mixed $response_status_line (line 2185)
mixed $scheme = '' (line 2173)
mixed $uri = '' (line 2171)
mixed $url = '' (line 2170)
mixed $username = '' (line 2192)
mixed $useSOAPAction = true (line 2186)
mixed $use_curl = false (line 2190)

#### Inherited Variables

Inherited from nusoap_base

> nusoap_base::$charencoding
> nusoap_base::$debugLevel
> nusoap_base::$debug_str
> nusoap_base::$error_str
> nusoap_base::$namespaces
> nusoap_base::$revision
> nusoap_base::$soap_defencoding
> nusoap_base::$title
> nusoap_base::$typemap
> nusoap_base::$usedNamespaces
> nusoap_base::$version
> nusoap_base::$xmlEntities
> nusoap_base::$XMLSchemaVersion

Methods
Constructor soap_transport_http (line 2213)

constructor

- access: public

soap_transport_http soap_transport_http (string $url, [array $curl_options = NULL], [boolean $use_curl = false])

- string $url: The URL to which to connect
- array $curl_options: User-specified cURL options
- boolean $use_curl: Whether to try to force cURL use

buildPayload (line 2841)

Writes the payload, including HTTP headers, to $this->outgoing_payload.

- access: private

void buildPayload (string $data, [string $cookie_str = ''])

- string $data: HTTP body
- string $cookie_str: data for HTTP Cookie header

connect (line 2330)

establish an HTTP connection

- return: true if connected, false if not
- access: private

boolean connect (mixed $connection_timeout, [integer $response_timeout = 30], integer $timeout)

- integer $timeout: set connection timeout in seconds
- integer $response_timeout: set response timeout in seconds

decodeChunked (line 2784)

decode a string that is encoded w/ "chunked' transfer encoding as defined in RFC2068 19.4.6

- deprecated:
- access: public

string decodeChunked (string $buffer, string $lb)

- string $buffer
- string $lb

getCookiesForRequest (line 3419)

sort out cookies for the current request

- return: for Cookie-HTTP-Header
- access: private

string getCookiesForRequest (array $cookies, [boolean $secure = false])

- array $cookies: array with all cookies
- boolean $secure: is the send-content secure or not?

getResponse (line 2947)

gets the SOAP response via HTTP[S]

- return: the response (also sets member variables like incoming_payload)
- access: private

string getResponse ()
io_method (line 2314)

gets the I/O method to use

- return: I/O method to use (socket|curl|unknown)
- access: private

string io_method ()
isSkippableCurlHeader (line 2757)

Test if the given string starts with a header that is to be skipped.

Skippable headers result from chunked transfer and proxy requests.

- return: Whether a skippable header was found.
- access: private

boolean isSkippableCurlHeader (string &$data)

- string $data: The string to check.

parseCookie (line 3355)

parse an incoming Cookie into it's parts

- return: with data of that cookie
- access: private

array parseCookie (string $cookie_str)

- string $cookie_str: content of cookie

send (line 2566)

sends the SOAP request and gets the SOAP response via HTTP[S]

- return: data
- access: public

string send (string $data, integer $timeout, [integer $response_timeout = 30], [array $cookies = NULL])

- string $data: message data
- integer $timeout: set connection timeout in seconds
- integer $response_timeout: set response timeout in seconds
- array $cookies: cookies to send

sendHTTPS (line 2607)

sends the SOAP request and gets the SOAP response via HTTPS using CURL

- return: data
- deprecated:
- access: public

string sendHTTPS (string $data, integer $timeout, [integer $response_timeout = 30], array $cookies)

- string $data: message data
- integer $timeout: set connection timeout in seconds
- integer $response_timeout: set response timeout in seconds
- array $cookies: cookies to send

sendRequest (line 2890)

sends the SOAP request via HTTP[S]

- return: true if OK, false if problem
- access: private

boolean sendRequest (string $data, [array $cookies = NULL])

- string $data: message data
- array $cookies: cookies to send

setContentType (line 3325)

sets the content-type for the SOAP message to be sent

- access: public

void setContentType (string $type, [mixed $charset = false])

- string $type: the content type, MIME style
- mixed $charset: character set used for encoding (or false)

setCredentials (line 2621)

if authenticating, set user credentials here

- access: public

void setCredentials (string $username, string $password, [string $authtype = 'basic'], [array $digestRequest = array()], [array $certRequest = array()])

- string $username
- string $password
- string $authtype: (basic|digest|certificate|ntlm)
- array $digestRequest: (keys must be nonce, nc, realm, qop)
- array $certRequest: (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, certpassword (optional), verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs)

setCurlOption (line 2233)

sets a cURL option

- access: private

void setCurlOption (mixed $option, mixed $value)

- mixed $option: The cURL option (always integer?)
- mixed $value: The cURL option value

setEncoding (line 2705)

use http encoding

- access: public

void setEncoding ([string $enc = 'gzip, deflate'])

- string $enc: encoding style. supported values: gzip, deflate, or both

setHeader (line 2246)

sets an HTTP header

- access: private

void setHeader (string $name, string $value)

- string $name: The name of the header
- string $value: The value of the header

setProxy (line 2729)

set proxy info here

- access: public

void setProxy (string $proxyhost, string $proxyport, [string $proxyusername = ''], [string $proxypassword = ''], [string $proxyauthtype = 'basic'])

- string $proxyhost: use an empty string to remove proxy
- string $proxyport
- string $proxyusername
- string $proxypassword
- string $proxyauthtype: (basic|ntlm)

setSOAPAction (line 2695)

set the soapaction value

- access: public

void setSOAPAction (string $soapaction)

- string $soapaction

setURL (line 2270)

sets the URL to which to connect

- access: private

void setURL (string $url)

- string $url: The URL to which to connect

unsetHeader (line 2257)

unsets an HTTP header

- access: private

void unsetHeader (string $name)

- string $name: The name of the header

usePersistentConnection (line 3335)

specifies that an HTTP persistent connection should be used

- return: whether the request was honored by this method.
- access: public

boolean usePersistentConnection ()

#### Inherited Methods

Inherited From nusoap_base

> nusoap_base::nusoap_base()
> nusoap_base::appendDebug()
> nusoap_base::clearDebug()
> nusoap_base::contractQname()
> nusoap_base::debug()
> nusoap_base::expandEntities()
> nusoap_base::expandQname()
> nusoap_base::formatDump()
> nusoap_base::getDebug()
> nusoap_base::getDebugAsXMLComment()
> nusoap_base::getDebugLevel()
> nusoap_base::getError()
> nusoap_base::getGlobalDebugLevel()
> nusoap_base::getLocalPart()
> nusoap_base::getmicrotime()
> nusoap_base::getNamespaceFromPrefix()
> nusoap_base::getPrefix()
> nusoap_base::getPrefixFromNamespace()
> nusoap_base::isArraySimpleOrStruct()
> nusoap_base::serializeEnvelope()
> nusoap_base::serialize_val()
> nusoap_base::setDebugLevel()
> nusoap_base::setError()
> nusoap_base::setGlobalDebugLevel()
> nusoap_base::varDump()
> nusoap_base::__toString()

Documentation generated on Mon, 26 Apr 2010 16:17:06 -0400 by phpDocumentor 1.3.0RC3