XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
nusoap_client Class Reference
Inheritance diagram for nusoap_client:
nusoap_base

Public Member Functions

 __construct ($endpoint, $wsdl=false, $proxyhost=false, $proxyport=false, $proxyusername=false, $proxypassword=false, $timeout=0, $response_timeout=30, $portName='')
 
 call ($operation, $params=[], $namespace='https://tempuri.org', $soapAction='', $headers=false, $rpcParams=null, $style='rpc', $use='encoded')
 
 checkWSDL ()
 
 loadWSDL ()
 
 getOperationData ($operation)
 
 send ($msg, $soapaction='', $timeout=0, $response_timeout=30)
 
 parseResponse ($headers, $data)
 
 setCurlOption ($option, $value)
 
 setEndpoint ($endpoint)
 
 setHeaders ($headers)
 
 getHeaders ()
 
 getHeader ()
 
 setHTTPProxy ($proxyhost, $proxyport, $proxyusername='', $proxypassword='')
 
 setCredentials ($username, $password, $authtype='basic', $certRequest=[])
 
 setHTTPEncoding ($enc='gzip, deflate')
 
 setUseCURL ($use)
 
 useHTTPPersistentConnection ()
 
 getDefaultRpcParams ()
 
 setDefaultRpcParams ($rpcParams)
 
 getProxy ()
 
 _getProxyClassCode ($r)
 
 getProxyClassCode ()
 
 getHTTPBody ($soapmsg)
 
 getHTTPContentType ()
 
 getHTTPContentTypeCharset ()
 
 decodeUTF8 ($bool)
 
 setCookie ($name, $value)
 
 getCookies ()
 
 checkCookies ()
 
 UpdateCookies ($cookies)
 
- Public Member Functions inherited from nusoap_base
 __construct ()
 
 getGlobalDebugLevel ()
 
 setGlobalDebugLevel ($level)
 
 getDebugLevel ()
 
 setDebugLevel ($level)
 
 debug ($string)
 
 appendDebug ($string)
 
 clearDebug ()
 
getDebug ()
 
getDebugAsXMLComment ()
 
 expandEntities ($val)
 
 getError ()
 
 setError ($str)
 
 isArraySimpleOrStruct ($val)
 
 serialize_val ($val, $name=false, $type=false, $name_ns=false, $type_ns=false, $attributes=false, $use='encoded', $soapval=false)
 
 serializeEnvelope ($body, $headers=false, $namespaces=[], $style='rpc', $use='encoded', $encodingStyle='https://schemas.xmlsoap.org/soap/encoding/')
 
 formatDump ($str)
 
 contractQname ($qname)
 
 expandQname ($qname)
 
 getLocalPart ($str)
 
 getPrefix ($str)
 
 getNamespaceFromPrefix ($prefix)
 
 getPrefixFromNamespace ($ns)
 
 getmicrotime ()
 
 varDump ($data)
 
 __toString ()
 

Data Fields

 $username = ''
 
 $password = ''
 
 $authtype = ''
 
 $certRequest = []
 
 $requestHeaders = false
 
 $responseHeaders = ''
 
 $responseHeader = null
 
 $document = ''
 
 $endpoint
 
 $forceEndpoint = ''
 
 $proxyhost = ''
 
 $proxyport = ''
 
 $proxyusername = ''
 
 $proxypassword = ''
 
 $portName = ''
 
 $xml_encoding = ''
 
 $http_encoding = false
 
 $timeout = 0
 
 $response_timeout = 30
 
 $endpointType = ''
 
 $persistentConnection = false
 
 $defaultRpcParams = false
 
 $request = ''
 
 $response = ''
 
 $responseData = ''
 
 $cookies = []
 
 $decode_utf8 = true
 
 $operations = []
 
 $curl_options = []
 
 $bindingType = ''
 
 $use_curl = false
 
 $fault
 
 $faultcode
 
 $faultstring
 
 $faultdetail
 
- Data Fields inherited from nusoap_base
 $title = 'NuSOAP'
 
 $version = '0.9.5'
 
 $revision = '$Revision: 1.123 $'
 
 $error_str = ''
 
 $debug_str = ''
 
 $charencoding = true
 
 $debugLevel
 
 $XMLSchemaVersion = 'https://www.w3.org/2001/XMLSchema'
 
 $soap_defencoding = 'UTF-8'
 
 $namespaces
 
 $usedNamespaces = []
 
 $typemap
 
 $xmlEntities
 

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

Author
Dietrich Ayala dietr.nosp@m.ich@.nosp@m.ganx4.nosp@m..com
Scott Nichol snich.nosp@m.ol@u.nosp@m.sers..nosp@m.sour.nosp@m.cefor.nosp@m.ge.n.nosp@m.et
Version
Id
nusoap.php,v 1.123 2010/04/26 20:15:08 snichol Exp

@access public

Definition at line 7335 of file nusoap.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( $endpoint,
$wsdl = false,
$proxyhost = false,
$proxyport = false,
$proxyusername = false,
$proxypassword = false,
$timeout = 0,
$response_timeout = 30,
$portName = '' )

constructor

Parameters
mixed$endpointSOAP server or WSDL URL (string), or wsdl instance (object)
mixed$wsdloptional, set to 'wsdl' or true if using WSDL
bool$proxyhostoptional
bool$proxyportoptional
bool$proxyusernameoptional
bool$proxypasswordoptional
int$timeoutset the connection timeout
int$response_timeoutset the response timeout
string$portNameoptional portName in WSDL document @access public

Definition at line 7408 of file nusoap.php.

Member Function Documentation

◆ _getProxyClassCode()

_getProxyClassCode ( $r)

dynamically creates proxy class code

Parameters
$r
Returns
string PHP/NuSOAP code for the proxy class @access private

Definition at line 8083 of file nusoap.php.

◆ call()

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

calls method, returns PHP native type

Parameters
string$operationSOAP server URL or path
mixed$paramsAn 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$namespaceoptional method namespace (WSDL can override)
string$soapActionoptional SOAPAction value (WSDL can override)
mixed$headersoptional string of XML with SOAP header content, or array of soapval objects for SOAP headers, or associative array
bool$rpcParamsoptional (no longer used)
string$styleoptional (rpc|document) the style to use when serializing parameters (WSDL can override)
string$useoptional (encoded|literal) the use when serializing parameters (WSDL can override)
Returns
mixed response from SOAP call, normally an associative array mirroring the structure of the XML response, false for certain fatal errors @access public

Definition at line 7468 of file nusoap.php.

◆ checkCookies()

checkCookies ( )

checks all Cookies and delete those which are expired

Returns
bool always return true @access private

Definition at line 8234 of file nusoap.php.

◆ checkWSDL()

checkWSDL ( )

check WSDL passed as an instance or pulled from an endpoint

@access private

Definition at line 7652 of file nusoap.php.

◆ decodeUTF8()

decodeUTF8 ( $bool)

Definition at line 8194 of file nusoap.php.

◆ getCookies()

getCookies ( )

gets all Cookies

Returns
array with all internal cookies @access public

Definition at line 8223 of file nusoap.php.

◆ getDefaultRpcParams()

getDefaultRpcParams ( )

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.

Returns
bool @access public
Deprecated

Definition at line 8004 of file nusoap.php.

◆ getHeader()

getHeader ( )

get the SOAP response Header (parsed)

Returns
mixed @access public

Definition at line 7917 of file nusoap.php.

◆ getHeaders()

getHeaders ( )

get the SOAP response headers (namespace resolution incomplete)

Returns
string @access public

Definition at line 7906 of file nusoap.php.

◆ getHTTPBody()

getHTTPBody ( $soapmsg)

gets the HTTP body for the current request.

Parameters
string$soapmsgThe SOAP payload
Returns
string The HTTP body, which includes the SOAP payload @access private

Definition at line 8156 of file nusoap.php.

◆ getHTTPContentType()

getHTTPContentType ( )

gets the HTTP content type for the current request.

Note: getHTTPBody must be called before this.

Returns
string the HTTP content type for the current request. @access private

Definition at line 8169 of file nusoap.php.

◆ getHTTPContentTypeCharset()

getHTTPContentTypeCharset ( )

gets the HTTP content type charset for the current request. returns false for non-text content types.

Note: getHTTPBody must be called before this.

Returns
string the HTTP content type charset for the current request. @access private

Definition at line 8183 of file nusoap.php.

◆ getOperationData()

getOperationData ( $operation)

get available data pertaining to an operation

Parameters
string$operationoperation name
Returns
array array of data pertaining to the operation @access public

Definition at line 7703 of file nusoap.php.

◆ getProxy()

getProxy ( )

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

Returns
object soap_proxy object @access public

Definition at line 8032 of file nusoap.php.

◆ getProxyClassCode()

getProxyClassCode ( )

dynamically creates proxy class code

Returns
string PHP/NuSOAP code for the proxy class @access public

Definition at line 8143 of file nusoap.php.

◆ loadWSDL()

loadWSDL ( )

instantiate wsdl object and parse wsdl file

@access public

Definition at line 7687 of file nusoap.php.

◆ parseResponse()

parseResponse ( $headers,
$data )

processes SOAP message returned from server

Parameters
array$headersThe HTTP headers
string$dataunprocessed response data from server
Returns
mixed value of the message, decoded into a PHP type @access private

Definition at line 7811 of file nusoap.php.

◆ send()

send ( $msg,
$soapaction = '',
$timeout = 0,
$response_timeout = 30 )

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.

Parameters
string$msga SOAPx4 soapmsg object
string$soapactionSOAPAction value
int$timeoutset connection timeout in seconds
int$response_timeoutset response timeout in seconds
Returns
mixed native PHP types. @access private

Definition at line 7731 of file nusoap.php.

◆ setCookie()

setCookie ( $name,
$value )

adds a new Cookie into $this->cookies array

Parameters
string$nameCookie Name
string$valueCookie Value
Returns
bool if cookie-set was successful returns true, else false @access public

Definition at line 8208 of file nusoap.php.

◆ setCredentials()

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

if authenticating, set user credentials here

Parameters
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) @access public

Definition at line 7948 of file nusoap.php.

◆ setCurlOption()

setCurlOption ( $option,
$value )

sets user-specified cURL options

Parameters
mixed$optionThe cURL option (always integer?)
mixed$valueThe cURL option value @access public

Definition at line 7868 of file nusoap.php.

◆ setDefaultRpcParams()

setDefaultRpcParams ( $rpcParams)

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.

Parameters
bool$rpcParams@access public
Deprecated

Definition at line 8020 of file nusoap.php.

◆ setEndpoint()

setEndpoint ( $endpoint)

sets the SOAP endpoint, which can override WSDL

Parameters
string$endpointThe endpoint URL to use, or empty string or false to prevent override @access public

Definition at line 7881 of file nusoap.php.

◆ setHeaders()

setHeaders ( $headers)

set the SOAP headers

Parameters
mixed$headersString of XML with SOAP header content, or array of soapval objects for SOAP headers @access public

Definition at line 7893 of file nusoap.php.

◆ setHTTPEncoding()

setHTTPEncoding ( $enc = 'gzip,
deflate'  )

use HTTP encoding

Parameters
string$encHTTP encoding @access public

Definition at line 7964 of file nusoap.php.

◆ setHTTPProxy()

setHTTPProxy ( $proxyhost,
$proxyport,
$proxyusername = '',
$proxypassword = '' )

set proxy info here

Parameters
string$proxyhost
string$proxyport
string$proxyusername
string$proxypassword@access public

Definition at line 7931 of file nusoap.php.

◆ setUseCURL()

setUseCURL ( $use)

Set whether to try to use cURL connections if possible

Parameters
bool$useWhether to try to use cURL @access public

Definition at line 7976 of file nusoap.php.

◆ UpdateCookies()

UpdateCookies ( $cookies)

updates the current cookies with a new set

Parameters
array$cookiesnew cookies with which to update current ones
Returns
bool always return true @access private

Definition at line 8268 of file nusoap.php.

◆ useHTTPPersistentConnection()

useHTTPPersistentConnection ( )

use HTTP persistent connections if possible

@access public

Definition at line 7987 of file nusoap.php.

Field Documentation

◆ $authtype

$authtype = ''

Definition at line 7340 of file nusoap.php.

◆ $bindingType

$bindingType = ''

Definition at line 7367 of file nusoap.php.

◆ $certRequest

$certRequest = []

Definition at line 7341 of file nusoap.php.

◆ $cookies

$cookies = []

Definition at line 7363 of file nusoap.php.

◆ $curl_options

$curl_options = []

Definition at line 7366 of file nusoap.php.

◆ $decode_utf8

$decode_utf8 = true

Definition at line 7364 of file nusoap.php.

◆ $defaultRpcParams

$defaultRpcParams = false

Definition at line 7359 of file nusoap.php.

◆ $document

$document = ''

Definition at line 7345 of file nusoap.php.

◆ $endpoint

$endpoint

Definition at line 7346 of file nusoap.php.

◆ $endpointType

$endpointType = ''

Definition at line 7357 of file nusoap.php.

◆ $fault

$fault

Definition at line 7377 of file nusoap.php.

◆ $faultcode

$faultcode

Definition at line 7382 of file nusoap.php.

◆ $faultdetail

$faultdetail

Definition at line 7392 of file nusoap.php.

◆ $faultstring

$faultstring

Definition at line 7387 of file nusoap.php.

◆ $forceEndpoint

$forceEndpoint = ''

Definition at line 7347 of file nusoap.php.

◆ $http_encoding

$http_encoding = false

Definition at line 7354 of file nusoap.php.

◆ $operations

$operations = []

Definition at line 7365 of file nusoap.php.

◆ $password

$password = ''

Definition at line 7339 of file nusoap.php.

◆ $persistentConnection

$persistentConnection = false

Definition at line 7358 of file nusoap.php.

◆ $portName

$portName = ''

Definition at line 7352 of file nusoap.php.

◆ $proxyhost

$proxyhost = ''

Definition at line 7348 of file nusoap.php.

◆ $proxypassword

$proxypassword = ''

Definition at line 7351 of file nusoap.php.

◆ $proxyport

$proxyport = ''

Definition at line 7349 of file nusoap.php.

◆ $proxyusername

$proxyusername = ''

Definition at line 7350 of file nusoap.php.

◆ $request

$request = ''

Definition at line 7360 of file nusoap.php.

◆ $requestHeaders

$requestHeaders = false

Definition at line 7342 of file nusoap.php.

◆ $response

$response = ''

Definition at line 7361 of file nusoap.php.

◆ $response_timeout

$response_timeout = 30

Definition at line 7356 of file nusoap.php.

◆ $responseData

$responseData = ''

Definition at line 7362 of file nusoap.php.

◆ $responseHeader

$responseHeader = null

Definition at line 7344 of file nusoap.php.

◆ $responseHeaders

$responseHeaders = ''

Definition at line 7343 of file nusoap.php.

◆ $timeout

$timeout = 0

Definition at line 7355 of file nusoap.php.

◆ $use_curl

$use_curl = false

Definition at line 7368 of file nusoap.php.

◆ $username

$username = ''

Definition at line 7338 of file nusoap.php.

◆ $xml_encoding

$xml_encoding = ''

Definition at line 7353 of file nusoap.php.


The documentation for this class was generated from the following file: