Package DE_EPAGES::WebService::API::WebService::BaseService
Base class for web services with permission handling.
Functions
- CheckPermission
- checkMandatoryFields
- getEpagesTypesUrn
- getMimeParts
- getXmlSchemaUrn
- mapType
- new
- object
- soapBool
- soapData
- soapDataType
- soapDataValue
- soapDateTime
- soapError
- soapFloat
- soapInt
- soapList
- soapLocList
- soapPath
- soapString
- user
CheckPermission
Checks if the user identified by $Login and $Password has permission to to execute the method $Method of the web service $WebService.
Syntax |
$IsAllowed = $self->CheckPermission( $WebService, $Method, $Login, $Password ); |
Input |
|
Return |
|
checkMandatoryFields
No WebService-Method! checks if fields are in structure and not empty return 1 if all tests passed.
Syntax |
$self->checkMandatoryFields( $hStructure, $aField ) |
Input |
|
getEpagesTypesUrn
returns the epages types urn of the service (was set by constructor new()
Syntax |
$Service->getEpagesTypesUrn(); |
Return |
|
getMimeParts
get the MIME::Entity parts of the current request. All parts are returned as a list of MIME::Entity objects Used to transfer Binaries via Webservices (If you would get the attachment of a part you have to filter out the MIME::Entity parts with attachments!)
Syntax |
$self->getMimeParts() |
Return |
|
getXmlSchemaUrn
returns the schema urn of the service (was set by constructor new()
Syntax |
$Service->getXmlSchemaUrn(); |
Return |
|
mapType
Map the given XSD Types to a specific Uri.
Syntax |
$service->mapType($aTypes, $Uri); |
Example |
$self->mapType(['TProduct, TPrice], 'urn://myservice/2005/06'); |
Return |
|
new
Creates a new web service object as a blessed hash reference and adds the values from the %Options hash.
Syntax |
$Service = DE_EPAGES::WebService::API::WebService::BaseService->new( %Options ); |
Input |
|
Return |
|
object
Returns the base object on which the WebService will act.
Syntax |
$base_object = $service->object; |
Return |
|
soapBool
build a SOAP::Data structure of type boolean the returned SOAP::Data object can call SOAP::Data methods
Syntax |
$service->soapBool($isCondition); |
Example |
$self->soapBool(0); $self->soapBool(1)->method(); |
Input |
|
Return |
|
soapData
Crates a simple SOAP::Data element containing cdata DateTime object are auto formatted value are quoted before SOAP::Lite do it automatically if no type given
Syntax |
soapData( $name, $value, $type ); |
Input |
|
Return |
|
soapDataType
build a SOAP::Data structure of passed type and value the returned SOAP::Data object can call SOAP::Data methods like attr()
Syntax |
$service->soapDataType($Type, $Value); |
Example |
$self->soapDataType('String', 'example'); $self->soapDataType('TMyType', $soapStructure ); $self->soapDataType('anyType', $hStructure ); $self->soapDataType('String', 'additionalAttr')->attr($hAttr); |
Input |
|
Return |
|
soapDataValue
build a SOAP::Data structure of passed type and value the returned SOAP::Data object can call SOAP::Data methods like attr()
Syntax |
$service->soapDataValue($Value, $Type); |
Example |
$self->soapDataValue('String', 'example'); $self->soapDataValue('TMyType', $soapStructure ); $self->soapDataValue('anyType', $hStructure ); $self->soapDataValue('String', 'additionalAttr')->attr($hAttr); |
Input |
|
Return |
|
soapDateTime
build a SOAP::Data structure of type datetime datime will adjust to system time zone and format by SOAPDateTimeFormatXML formatter the returned SOAP::Data object can call SOAP::Data methods
Syntax |
$service->soapDateTime($datetime); |
Example |
$self->soapDateTime($Order->get('ShippedOn'); |
Input |
|
Return |
|
soapError
Map the given XSD Types to a specific Uri.
Syntax |
$service->soapError($Error); |
Example |
$self->soapError($Error); $Error = GetError(); $soapProduct = $self->soapDataType('TGetInfo_Return', { 'Path' => $self->soapPath($Product), 'Error' => $self->soapError($Error) }); |
Return |
|
soapFloat
build a SOAP::Data structure of type float the returned SOAP::Data object can call SOAP::Data methods
Syntax |
$service->soapFloat($Value); |
Example |
$self->soapFloat(17.559); $self->soapFloat(.001)->method(); |
Input |
|
Return |
|
soapInt
build a SOAP::Data structure of type integer the returned SOAP::Data object can call SOAP::Data methods
Syntax |
$service->soapInt($Value); |
Example |
$self->soapInt(17); $self->soapInt(1)->method(); |
Input |
|
Return |
|
soapList
build a complex SOAP::Data structure of list (array) of same type the array will passed with content to handle by SOAP::Lite but empty array will handled with type and uri the returned SOAP::Data object can call SOAP::Data methods
Syntax |
$service->soapList($aList, $Type, $Uri); |
Example |
$self->soapList($aPaths,'string'); $self->soapList($aAttributes,'TAttribute'); $self->soapList($aVars,'TMyType','urn://vendor.do.main/WS/Types'); |
Input |
|
Return |
|
soapLocList
build a complex SOAP::Data structure of list (array) of localized string localized values of the passed attribute will get by soapLocalizedValues
Syntax |
$service->soapLocList($object, $AttrName, $aLanguages, $Uri); |
Example |
$self->soapLocList($product, 'Description', ['de','en']); |
Input |
|
Return |
|
soapPath
build a SOAP::Data structure of type string with object path value or undef if no path the returned SOAP::Data object can call SOAP::Data methods
Syntax |
$service->soapPath($Object); |
Example |
$self->soapPath(0); $self->soapPath(1)->method(); |
Input |
|
Return |
|
soapString
build a SOAP::Data structure of type string the returned SOAP::Data object can call SOAP::Data methods like prefix() if need a specific name space
Syntax |
$service->soapString($Value); |
Example |
$self->soapString('example'); $self->soapString('additionalAttr')->prefix('ns2'); |
Input |
|
Return |
|
user
Returns the User object of the current user of the WebService.
Syntax |
$user_object = $service->user; |
Return |
|