Class soapclient

Description

soapclient higher level class for easy usage.

usage:

// instantiate client with server info $soapclient = new soapclient( string path [ ,boolean 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.94 2005/08/04 01:27:42 snichol Exp $
  • author: Dietrich Ayala <dietrich@ganx4.com>

Located in /nusoap.php (line 6322)

nusoap_base
   |
   --soapclient
Direct descendents
Class Description
 class soapclientmime soapclientmime 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
 soapclient soapclient (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 (mixed $operation, [mixed $params = array()], [string $namespace = 'http://tempuri.org'], [string $soapAction = ''], [mixed $headers = false], [boolean $rpcParams = null], [string $style = 'rpc'], [string $use = 'encoded'], string $method)
 always checkCookies ()
 void decodeUTF8 (mixed $bool)
 array getCookies ()
 boolean getDefaultRpcParams ()
 string getHeaders ()
 string getHTTPBody (string $soapmsg)
 string getHTTPContentType ()
 array getOperationData (string $operation)
 object soap_proxy getProxy ()
 string getProxyClassCode ()
 mixed parseResponse (array $headers, string $data)
 mixed send (string $msg, [string $soapaction = ''], integer $timeout, [integer $response_timeout = 30])
 if setCookie (string $name, string $value)
 void setCredentials (string $username, string $password, [string $authtype = 'basic'], [array $certRequest = array()])
 void setDefaultRpcParams (boolean $rpcParams)
 void setEndpoint ($endpoint $endpoint)
 void setHeaders ($headers $headers)
 void setHTTPEncoding ([string $enc = 'gzip, deflate'])
 void setHTTPProxy (string $proxyhost, string $proxyport, [string $proxyusername = ''], [string $proxypassword = ''])
 always UpdateCookies (array $cookies)
 string _getProxyClassCode (mixed $r)
Variables
mixed $authtype = '' (line 6326)
mixed $certRequest = array() (line 6327)
mixed $cookies = array() (line 6347)
mixed $decode_utf8 = true (line 6348)
mixed $defaultRpcParams = false (line 6343)
mixed $document = '' (line 6330)
mixed $endpoint (line 6331)
mixed $endpointType = '' (line 6341)
fault $fault (line 6358)
  • access: public
faultcode $faultcode (line 6363)
  • access: public
faultdetail $faultdetail (line 6373)
  • access: public
faultstring $faultstring (line 6368)
  • access: public
mixed $forceEndpoint = '' (line 6332)
mixed $http_encoding = false (line 6338)
mixed $operations = array() (line 6349)
mixed $password = '' (line 6325)
mixed $persistentConnection = false (line 6342)
mixed $proxyhost = '' (line 6333)
mixed $proxypassword = '' (line 6336)
mixed $proxyport = '' (line 6334)
mixed $proxyusername = '' (line 6335)
mixed $request = '' (line 6344)
mixed $requestHeaders = false (line 6328)
mixed $response = '' (line 6345)
mixed $responseData = '' (line 6346)
mixed $responseHeaders = '' (line 6329)
mixed $response_timeout = 30 (line 6340)
mixed $timeout = 0 (line 6339)
mixed $username = '' (line 6324)
mixed $xml_encoding = '' (line 6337)

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 soapclient (line 6389)

constructor

  • access: public
soapclient soapclient (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 6457)

calls method, returns PHP native type

  • return: response from SOAP call
  • access: public
mixed call (mixed $operation, [mixed $params = array()], [string $namespace = 'http://tempuri.org'], [string $soapAction = ''], [mixed $headers = false], [boolean $rpcParams = null], [string $style = 'rpc'], [string $use = 'encoded'], string $method)
  • string $method: 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
  • 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 7061)

checks all Cookies and delete those which are expired

  • return: return true
  • access: private
always checkCookies ()
decodeUTF8 (line 7024)
void decodeUTF8 (mixed $bool)
getCookies (line 7051)

gets all Cookies

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

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 ()
getHeaders (line 6801)

get the SOAP response headers (namespace resolution incomplete)

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

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

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

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

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

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

dynamically creates proxy class code

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

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

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

adds a new Cookie into $this->cookies array

  • return: cookie-set was successful returns true, else false
  • access: public
if setCookie (string $name, string $value)
  • string $name: Cookie Name
  • string $value: Cookie Value
setCredentials (line 6830)

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)
  • array $certRequest: (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs)
setDefaultRpcParams (line 6882)

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

sets the SOAP endpoint, which can override WSDL

  • access: public
void setEndpoint ($endpoint $endpoint)
  • $endpoint $endpoint: string The endpoint URL to use, or empty string or false to prevent override
setHeaders (line 6791)

set the SOAP headers

  • access: public
void setHeaders ($headers $headers)
  • $headers $headers: mixed String of XML with SOAP header content, or array of soapval objects for SOAP headers
setHTTPEncoding (line 6843)

use HTTP encoding

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

set proxy info here

  • access: public
void setHTTPProxy (string $proxyhost, string $proxyport, [string $proxyusername = ''], [string $proxypassword = ''])
  • string $proxyhost
  • string $proxyport
  • string $proxyusername
  • string $proxypassword
UpdateCookies (line 7094)

updates the current cookies with a new set

  • return: return true
  • access: private
always UpdateCookies (array $cookies)
  • array $cookies: new cookies with which to update current ones
useHTTPPersistentConnection (line 6852)

use HTTP persistent connections if possible

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

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

Documentation generated on Wed, 3 Aug 2005 21:29:36 -0400 by phpDocumentor 1.3.0RC3