Class 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);

Located in /nusoap.php (line 6957)

nusoap_base
   |
   --nusoap_client
Direct descendents
Class Description
 class soapclient For backwards compatiblity, define soapclient unless the PHP SOAP extension is loaded.
 class 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
Method Summary
 nusoap_client nusoap_client (mixed $endpoint, [bool $wsdl = false], [string $proxyhost = false], [string $proxyport = false], [string $proxyusername = false], [string $proxypassword = false], integer $timeout, [integer $response_timeout = 30], int $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 ()
 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)
 string _getProxyClassCode (mixed $r)
Variables
mixed $authtype = '' (line 6961)
mixed $bindingType = '' (line 6987)
mixed $certRequest = array() (line 6962)
mixed $cookies = array() (line 6983)
mixed $curl_options = array() (line 6986)
mixed $decode_utf8 = true (line 6984)
mixed $defaultRpcParams = false (line 6979)
mixed $document = '' (line 6966)
mixed $endpoint (line 6967)
mixed $endpointType = '' (line 6977)
fault $fault (line 6997)
  • access: public
faultcode $faultcode (line 7002)
  • access: public
faultdetail $faultdetail (line 7012)
  • access: public
faultstring $faultstring (line 7007)
  • access: public
mixed $forceEndpoint = '' (line 6968)
mixed $http_encoding = false (line 6974)
mixed $operations = array() (line 6985)
mixed $password = '' (line 6960)
mixed $persistentConnection = false (line 6978)
mixed $proxyhost = '' (line 6969)
mixed $proxypassword = '' (line 6972)
mixed $proxyport = '' (line 6970)
mixed $proxyusername = '' (line 6971)
mixed $request = '' (line 6980)
mixed $requestHeaders = false (line 6963)
mixed $response = '' (line 6981)
mixed $responseData = '' (line 6982)
mixed $responseHeader = NULL (line 6965)
mixed $responseHeaders = '' (line 6964)
mixed $response_timeout = 30 (line 6976)
mixed $timeout = 0 (line 6975)
mixed $username = '' (line 6959)
mixed $use_curl = false (line 6988)
mixed $xml_encoding = '' (line 6973)

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 7028)

constructor

  • access: public
nusoap_client nusoap_client (mixed $endpoint, [bool $wsdl = false], [string $proxyhost = false], [string $proxyport = false], [string $proxyusername = false], [string $proxypassword = false], integer $timeout, [integer $response_timeout = 30], int $portName)
  • mixed $endpoint: SOAP server or WSDL URL (string), or wsdl instance (object)
  • bool $wsdl: optional, set to true if using WSDL
  • int $portName: optional portName in WSDL document
  • string $proxyhost
  • string $proxyport
  • string $proxyusername
  • string $proxypassword
  • integer $timeout: set the connection timeout
  • integer $response_timeout: set the response timeout
call (line 7086)

calls method, returns PHP native type

  • return: response from SOAP call
  • 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 7805)

checks all Cookies and delete those which are expired

  • return: always return true
  • access: private
boolean checkCookies ()
checkWSDL (line 7268)

check WSDL passed as an instance or pulled from an endpoint

  • access: private
void checkWSDL ()
decodeUTF8 (line 7768)
void decodeUTF8 (mixed $bool)
getCookies (line 7795)

gets all Cookies

  • return: with all internal cookies
  • access: public
array getCookies ()
getDefaultRpcParams (line 7592)

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 7511)

get the SOAP response Header (parsed)

  • access: public
mixed getHeader ()
getHeaders (line 7501)

get the SOAP response headers (namespace resolution incomplete)

  • access: public
string getHeaders ()
getHTTPBody (line 7733)

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:
getHTTPContentType (line 7745)

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:
getHTTPContentTypeCharset (line 7758)

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:
getOperationData (line 7309)

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 7618)

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 7721)

dynamically creates proxy class code

  • return: PHP/NuSOAP code for the proxy class
  • access: public
string getProxyClassCode ()
loadWSDL (line 7294)

instantiate wsdl object and parse wsdl file

  • access: public
void loadWSDL ()
parseResponse (line 7414)

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:
send (line 7335)

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 7781)

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 7540)

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 7466)

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 7607)

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 7478)

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 7489)

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 7555)

use HTTP encoding

  • access: public
void setHTTPEncoding ([string $enc = 'gzip, deflate'])
  • string $enc: HTTP encoding
setHTTPProxy (line 7524)

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 7566)

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 7838)

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 7576)

use HTTP persistent connections if possible

  • access: public
void useHTTPPersistentConnection ()
_getProxyClassCode (line 7666)

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 Tue, 06 Nov 2007 10:36:01 -0500 by phpDocumentor 1.3.0RC3