## nusoap_client

Description

[nu]soapclient higher level class for easy usage.

usage:

// instantiate client with server info $soapclient = new nusoap_client( string path [ ,mixed wsdl] );

// call method, get results echo $soapclient->call( string methodname [ ,array parameters] );

// bye bye client unset($soapclient);

- access: public
- version: $Id: nusoap.php,v 1.123 2010/04/26 20:15:08 snichol Exp $
- author: Dietrich Ayala <dietrich@ganx4.com>
- author: Scott Nichol <snichol@users.sourceforge.net>

Located in /nusoap.php (line 7097)

    nusoap_base
       |
       --nusoap_client

Direct descendents

Class | Description
--- | ---
soapclient | For backwards compatiblity, define soapclient unless the PHP SOAP extension is loaded.
nusoap_client_mime | nusoap_client_mime client supporting MIME attachments defined at http://www.w3.org/TR/SOAP-attachments. It depends on the PEAR Mail_MIME library.

Variable Summary
mixed $authtype
mixed $bindingType
mixed $certRequest
mixed $cookies
mixed $curl_options
mixed $decode_utf8
mixed $defaultRpcParams
mixed $document
mixed $endpoint
mixed $endpointType
fault $fault
faultcode $faultcode
faultdetail $faultdetail
faultstring $faultstring
mixed $forceEndpoint
mixed $http_encoding
mixed $operations
mixed $password
mixed $persistentConnection
mixed $portName
mixed $proxyhost
mixed $proxypassword
mixed $proxyport
mixed $proxyusername
mixed $request
mixed $requestHeaders
mixed $response
mixed $responseData
mixed $responseHeader
mixed $responseHeaders
mixed $response_timeout
mixed $timeout
mixed $username
mixed $use_curl
mixed $xml_encoding
Method Summary
nusoap_client nusoap_client (mixed $endpoint, [mixed $wsdl = false], [string $proxyhost = false], [string $proxyport = false], [string $proxyusername = false], [string $proxypassword = false], integer $timeout, [integer $response_timeout = 30], [string $portName = ''])
mixed call (string $operation, [mixed $params = array()], [string $namespace = 'http://tempuri.org'], [string $soapAction = ''], [mixed $headers = false], [boolean $rpcParams = null], [string $style = 'rpc'], [string $use = 'encoded'])
boolean checkCookies ()
void checkWSDL ()
void decodeUTF8 (mixed $bool)
array getCookies ()
boolean getDefaultRpcParams ()
mixed getHeader ()
string getHeaders ()
string getHTTPBody (string $soapmsg)
string getHTTPContentType ()
string getHTTPContentTypeCharset ()
array getOperationData (string $operation)
object soap_proxy getProxy ()
string getProxyClassCode ()
void loadWSDL ()
mixed parseResponse (array $headers, string $data)
mixed send (string $msg, [string $soapaction = ''], integer $timeout, [integer $response_timeout = 30])
boolean setCookie (string $name, string $value)
void setCredentials (string $username, string $password, [string $authtype = 'basic'], [array $certRequest = array()])
void setCurlOption (mixed $option, mixed $value)
void setDefaultRpcParams (boolean $rpcParams)
void setEndpoint (string $endpoint)
void setHeaders (mixed $headers)
void setHTTPEncoding ([string $enc = 'gzip, deflate'])
void setHTTPProxy (string $proxyhost, string $proxyport, [string $proxyusername = ''], [string $proxypassword = ''])
void setUseCURL (boolean $use)
boolean UpdateCookies (array $cookies)
void useHTTPPersistentConnection ()
string _getProxyClassCode (mixed $r)
Variables
mixed $authtype = '' (line 7101)
mixed $bindingType = '' (line 7128)
mixed $certRequest = array() (line 7102)
mixed $cookies = array() (line 7124)
mixed $curl_options = array() (line 7127)
mixed $decode_utf8 = true (line 7125)
mixed $defaultRpcParams = false (line 7120)
mixed $document = '' (line 7106)
mixed $endpoint (line 7107)
mixed $endpointType = '' (line 7118)
fault $fault (line 7138)

- access: public

faultcode $faultcode (line 7143)

- access: public

faultdetail $faultdetail (line 7153)

- access: public

faultstring $faultstring (line 7148)

- access: public

mixed $forceEndpoint = '' (line 7108)
mixed $http_encoding = false (line 7115)
mixed $operations = array() (line 7126)
mixed $password = '' (line 7100)
mixed $persistentConnection = false (line 7119)
mixed $portName = '' (line 7113)
mixed $proxyhost = '' (line 7109)
mixed $proxypassword = '' (line 7112)
mixed $proxyport = '' (line 7110)
mixed $proxyusername = '' (line 7111)
mixed $request = '' (line 7121)
mixed $requestHeaders = false (line 7103)
mixed $response = '' (line 7122)
mixed $responseData = '' (line 7123)
mixed $responseHeader = NULL (line 7105)
mixed $responseHeaders = '' (line 7104)
mixed $response_timeout = 30 (line 7117)
mixed $timeout = 0 (line 7116)
mixed $username = '' (line 7099)
mixed $use_curl = false (line 7129)
mixed $xml_encoding = '' (line 7114)

#### 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 nusoap_client (line 7169)

constructor

- access: public

nusoap_client nusoap_client (mixed $endpoint, [mixed $wsdl = false], [string $proxyhost = false], [string $proxyport = false], [string $proxyusername = false], [string $proxypassword = false], integer $timeout, [integer $response_timeout = 30], [string $portName = ''])

- mixed $endpoint: SOAP server or WSDL URL (string), or wsdl instance (object)
- mixed $wsdl: optional, set to 'wsdl' or true if using WSDL
- string $proxyhost: optional
- string $proxyport: optional
- string $proxyusername: optional
- string $proxypassword: optional
- integer $timeout: set the connection timeout
- integer $response_timeout: set the response timeout
- string $portName: optional portName in WSDL document

call (line 7228)

calls method, returns PHP native type

- return: response from SOAP call, normally an associative array mirroring the structure of the XML response, false for certain fatal errors
- access: public

mixed call (string $operation, [mixed $params = array()], [string $namespace = 'http://tempuri.org'], [string $soapAction = ''], [mixed $headers = false], [boolean $rpcParams = null], [string $style = 'rpc'], [string $use = 'encoded'])

- string $operation: SOAP server URL or path
- mixed $params: An array, associative or simple, of the parameters for the method call, or a string that is the XML for the call. For rpc style, this call will wrap the XML in a tag named after the method, as well as the SOAP Envelope and Body. For document style, this will only wrap with the Envelope and Body. IMPORTANT: when using an array with document style, in which case there is really one parameter, the root of the fragment used in the call, which encloses what programmers normally think of parameters. A parameter array *must* include the wrapper.
- string $namespace: optional method namespace (WSDL can override)
- string $soapAction: optional SOAPAction value (WSDL can override)
- mixed $headers: optional string of XML with SOAP header content, or array of soapval objects for SOAP headers, or associative array
- boolean $rpcParams: optional (no longer used)
- string $style: optional (rpc|document) the style to use when serializing parameters (WSDL can override)
- string $use: optional (encoded|literal) the use when serializing parameters (WSDL can override)

checkCookies (line 7959)

checks all Cookies and delete those which are expired

- return: always return true
- access: private

boolean checkCookies ()
checkWSDL (line 7410)

check WSDL passed as an instance or pulled from an endpoint

- access: private

void checkWSDL ()
decodeUTF8 (line 7922)
void decodeUTF8 (mixed $bool)
getCookies (line 7949)

gets all Cookies

- return: with all internal cookies
- access: public

array getCookies ()
getDefaultRpcParams (line 7746)

gets the default RPC parameter setting.

If true, default is that call params are like RPC even for document style. Each call() can override this value.

This is no longer used.

- deprecated:
- access: public

boolean getDefaultRpcParams ()
getHeader (line 7665)

get the SOAP response Header (parsed)

- access: public

mixed getHeader ()
getHeaders (line 7655)

get the SOAP response headers (namespace resolution incomplete)

- access: public

string getHeaders ()
getHTTPBody (line 7887)

gets the HTTP body for the current request.

- return: The HTTP body, which includes the SOAP payload
- access: private

string getHTTPBody (string $soapmsg)

- string $soapmsg: The SOAP payload

Redefined in descendants as:

- nusoap_client_mime::getHTTPBody() : gets the HTTP body for the current request.

getHTTPContentType (line 7899)

gets the HTTP content type for the current request.

Note: getHTTPBody must be called before this.

- return: the HTTP content type for the current request.
- access: private

string getHTTPContentType ()

Redefined in descendants as:

- nusoap_client_mime::getHTTPContentType() : gets the HTTP content type for the current request.

getHTTPContentTypeCharset (line 7912)

gets the HTTP content type charset for the current request.

returns false for non-text content types.

Note: getHTTPBody must be called before this.

- return: the HTTP content type charset for the current request.
- access: private

string getHTTPContentTypeCharset ()

Redefined in descendants as:

- nusoap_client_mime::getHTTPContentTypeCharset() : gets the HTTP content type charset for the current request.

getOperationData (line 7459)

get available data pertaining to an operation

- return: array of data pertaining to the operation
- access: public

array getOperationData (string $operation)

- string $operation: operation name

getProxy (line 7772)

dynamically creates an instance of a proxy class, allowing user to directly call methods from wsdl

- return: object
- access: public

object soap_proxy getProxy ()
getProxyClassCode (line 7875)

dynamically creates proxy class code

- return: PHP/NuSOAP code for the proxy class
- access: public

string getProxyClassCode ()
loadWSDL (line 7444)

instantiate wsdl object and parse wsdl file

- access: public

void loadWSDL ()
parseResponse (line 7564)

processes SOAP message returned from server

- return: value of the message, decoded into a PHP type
- access: private

mixed parseResponse (array $headers, string $data)

- array $headers: The HTTP headers
- string $data: unprocessed response data from server

Redefined in descendants as:

- nusoap_client_mime::parseResponse() : processes SOAP message returned from server

send (line 7485)

send the SOAP message

Note: if the operation has multiple return values the return value of this method will be an array of those values.

- return: native PHP types.
- access: private

mixed send (string $msg, [string $soapaction = ''], integer $timeout, [integer $response_timeout = 30])

- string $msg: a SOAPx4 soapmsg object
- string $soapaction: SOAPAction value
- integer $timeout: set connection timeout in seconds
- integer $response_timeout: set response timeout in seconds

setCookie (line 7935)

adds a new Cookie into $this->cookies array

- return: if cookie-set was successful returns true, else false
- access: public

boolean setCookie (string $name, string $value)

- string $name: Cookie Name
- string $value: Cookie Value

setCredentials (line 7694)

if authenticating, set user credentials here

- access: public

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

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

setCurlOption (line 7620)

sets user-specified cURL options

- access: public

void setCurlOption (mixed $option, mixed $value)

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

setDefaultRpcParams (line 7761)

sets the default RPC parameter setting.

If true, default is that call params are like RPC even for document style Each call() can override this value.

This is no longer used.

- deprecated:
- access: public

void setDefaultRpcParams (boolean $rpcParams)

- boolean $rpcParams

setEndpoint (line 7632)

sets the SOAP endpoint, which can override WSDL

- access: public

void setEndpoint (string $endpoint)

- string $endpoint: The endpoint URL to use, or empty string or false to prevent override

setHeaders (line 7643)

set the SOAP headers

- access: public

void setHeaders (mixed $headers)

- mixed $headers: String of XML with SOAP header content, or array of soapval objects for SOAP headers

setHTTPEncoding (line 7709)

use HTTP encoding

- access: public

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

- string $enc: HTTP encoding

setHTTPProxy (line 7678)

set proxy info here

- access: public

void setHTTPProxy (string $proxyhost, string $proxyport, [string $proxyusername = ''], [string $proxypassword = ''])

- string $proxyhost
- string $proxyport
- string $proxyusername
- string $proxypassword

setUseCURL (line 7720)

Set whether to try to use cURL connections if possible

- access: public

void setUseCURL (boolean $use)

- boolean $use: Whether to try to use cURL

UpdateCookies (line 7992)

updates the current cookies with a new set

- return: always return true
- access: private

boolean UpdateCookies (array $cookies)

- array $cookies: new cookies with which to update current ones

useHTTPPersistentConnection (line 7730)

use HTTP persistent connections if possible

- access: public

void useHTTPPersistentConnection ()
_getProxyClassCode (line 7820)

dynamically creates proxy class code

- return: PHP/NuSOAP code for the proxy class
- access: private

string _getProxyClassCode (mixed $r)

#### 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:02 -0400 by phpDocumentor 1.3.0RC3