ePages 6.11.0 - DE_EPAGES/WebService/API/WebService/BaseService.pm

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
$WebService (object)
web service object
$Method (object)
web service method object
$Login (string)
login
$Password (string)
password
Return
$IsAllowed (boolean)
true if the method call is allowed

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
$hStructure (ref.hash.*)
hash of object data
$aField (ref.array.string)
field names to check

getEpagesTypesUrn

returns the epages types urn of the service (was set by constructor new()

Syntax
$Service->getEpagesTypesUrn();
Return
$TypesUrn (string)
web service epages types urn

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
$aEntities (ref.array.object)
list of MIME::Entity objects

getXmlSchemaUrn

returns the schema urn of the service (was set by constructor new()

Syntax
$Service->getXmlSchemaUrn();
Return
$SchemaUrn (string)
web service schema urn

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
$aTypes (ref.array.string)
list of types
$Uri (string)
uri to map to

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
%Options (hash)
user-defined values
Return
$Service (object)
web service object

object

Returns the base object on which the WebService will act.

Syntax
$base_object = $service->object;
Return
$Object (object)
base WebService object

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
$Value (boolean)
boolean value
Return
$soapDataType (object)
SOAP::Data object

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
$name (string)
Element name
$value (*)
Element value
$type (string)
Element type (optional)
Return
$data (object)
SOAP::Data element

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
$Type (string)
simple, complex or new defined type
simple types: string,float,integer,boolean, etc.
complex types: array,anyType,enum
new defined type: TError, TListOfPrices, etc.
$Value (string/hash/object)
scalar value by simple type or soap data structure
Return
$soapDataType (object)
SOAP::Data object

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
$Value (string/hash/object)
scalar value by simple type or soap data structure
$Type (string)
simple, complex or new defined type
simple types: string,float,integer,boolean, etc.
complex types: array,anyType,enum
new defined type: TError, TListOfPrices, etc.
Return
$soapDataType (object)
SOAP::Data object

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
$datetime (datetime)
datetime value
Return
$soapDataType (object)
SOAP::Data object

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
$aTypes (ref.array.string)
list of types
$Uri (string)
uri to map to

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
$Value (float)
float value
Return
$soapDataType (object)
SOAP::Data object

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
$Value (integer)
integer value
Return
$soapDataType (object)
SOAP::Data object

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
$aList (ref.array)
array of elements
$Type (string)
type of an element
$Uri (string)
schema uri of type namespace
Return
$soapDataType (object)
SOAP::Data object

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
$aList (ref.array)
array of elements
$Type (string)
type of an element
$Uri (string)
schema uri of type namespace
Return
$soapDataType (object)
SOAP::Data object

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
$Object (object)
object
Return
$soapDataType (object)
SOAP::Data object

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
$Value (string)
string value
Return
$soapDataType (object)
SOAP::Data object

user

Returns the User object of the current user of the WebService.

Syntax
$user_object = $service->user;
Return
$User (User object)
WebService User

Package SOAP::XMLSchema2001::Serializer