Inheritances
Files
Overview
FRAMES
NO FRAMES

Class SendXMLToWebService

SendXMLToWebService
|- class SendXMLToWebService
SendXMLToWebService
This class is for transmitting an http / POST request to Web service
through a XML document
AuthorMario Spada
CopyrightCopyright (c) 2015 Mario Spada
Licensehttp://opensource.org/licenses/GPL-2.0 GNU Public License
PackageSendXMLToWebService
Version0.1.0 2015/11/22

Summary

Instance fields
- $_extraHeaders Extra headers (private)
- $_pass Set password (private)
- $_url Set url (private)
- $_user Set username (private)
+ $charset Header Charset
+ $connecttimeout cURL option Connection time out
+ $contentType Header Content-type
+ $debug Enable cURL debug
+ $md5_pass Enable MD5 encryption for password
+ $post cURL option Post
+ $returntransfer cURL option Return transfer
+ $ssl_verifyhost cURL option SSL Verify Host
+ $ssl_verifypeer cURL option SSL Verify Peer
+ $timeout cURL option Time out
Instance methods
+ __construct()
- _checkRequisites() Check if cURL and allow_url_fopen are enabled, check url validity
- _getHeaders() Compose headers
+ printExtraHeaders() Prints out all additional headers
+ resetExtraHeaders() Remove all additional headers
+ sendXML() Send XML document to Web Service
+ setCredentials() Set username and password
+ setExtraHeader() Set an additional header
+ setExtraHeaders() Set multiple additional header at once in array format

Details

Instance fields

$_extraHeaders
private $_extraHeaders = array()
Extra headers (private)
Var array
$_pass
private $_pass = ''
Set password (private)
Var string
$_url
private $_url
Set url (private)
Var string
$_user
private $_user = ''
Set username (private)
Var string
$charset
public $charset = 'utf-8'
Header Charset
Var string
$connecttimeout
public $connecttimeout = 10
cURL option Connection time out
Var int
$contentType
public $contentType = 'text/xml'
Header Content-type
Var string
$debug
public $debug = true
Enable cURL debug
Var boolean
$md5_pass
public $md5_pass = false
Enable MD5 encryption for password
Var boolean
$post
public $post = true
cURL option Post
Var boolean
$returntransfer
public $returntransfer = true
cURL option Return transfer
Var boolean
$ssl_verifyhost
public $ssl_verifyhost = false
cURL option SSL Verify Host
Var boolean
$ssl_verifypeer
public $ssl_verifypeer = false
cURL option SSL Verify Peer
Var boolean
$timeout
public $timeout = 10
cURL option Time out
Var int

Instance methods

__construct()
public function __construct( $url)
Parameters
string $url url to connect to Web service
_checkRequisites()
private function _checkRequisites( )
Check if cURL and allow_url_fopen are enabled, check url validity
_getHeaders()
private function _getHeaders( $psLen)
Compose headers
Parameters
string $psLen length of the XML string
printExtraHeaders()
public function printExtraHeaders( )
Prints out all additional headers
resetExtraHeaders()
public function resetExtraHeaders( )
Remove all additional headers
sendXML()
public function sendXML( $post_string)
Send XML document to Web Service
Parameters
string $post_string string containing XML document
Returns string result string, usually in XML format
setCredentials()
public function setCredentials( $user
$pass
)
Set username and password
Parameters
string $user username
string $pass password
setExtraHeader()
public function setExtraHeader( $extraHeader)
Set an additional header
Parameters
string $extraHeader a valid header row
setExtraHeaders()
public function setExtraHeaders( $extraHeaders)
Set multiple additional header at once in array format
Parameters
array $extraHeaders an array with multiple header rows