ePages 6.11.0 - DE_EPAGES/Shop/API/WebService/BaseShopService.pm

Package DE_EPAGES::Shop::API::WebService::BaseShopService

Base class for shop web services (with shop as object).

Base
DE_EPAGES::WebService::API::WebService::BaseService

Functions

CheckPermission
checkFeature
checkShopObject
existsShopObject
featureAlias
featureCount
getCurrencyIDs
getLanguageIDs
getServiceTypesUrn
getServiceUrn
getShopTypesUrn
loadShopObject
loadTaxArea
loadTaxClass
mapType
new
object
setAddress
setAddressNamed
setAddressesNamed
soapAdditionalAddressesNamed
soapAddress
soapAddressNamed
soapList

CheckPermission

Checks if the user is allowed to execute a web service method on the user's shop. Checks if the shop has the feature 'WebServices' or if the web service method is called by an authorized client application.

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

checkFeature

check if feature activated and enougth WS calls allowed produce an error if not enogth WS calls allowd

Syntax
$self->checkFeature;

checkShopObject

No WebService-Method! checks if a object belongs to the current shop and is instance of a certain class rises error if not.

Syntax
$self->checkShopObject( $Object, $ClassAlias )
Input
$Object (object)
test object
$ClassAlias (string)
alias of a class (optional)

existsShopObject

No WebService-Method! returns 0 if object does not exist. object does not belongs to a site (shop). object is not instance of a certain class. return 1 if all tests passed.

Syntax
$self->existsShopObject( $Path, $ClassAlias )
Input
$Shop (shop object)
shop
$Path (string)
object path to load
$ClassAlias (string)
alias of a class (optional)

featureAlias

simply returns the Alias of the current Webservie feature

Syntax
my $FeatureAlias = $self->featureAlias;
Return
$FeatureAlias (string)
alias of WS

featureCount

returns the number of available allowed WebService calls today

Syntax
my $FeatureCount = $self->featureCount($Feature);
Input
$Feature (object)
feature object
Return
$FeatureCount (integer)
number of available WS calls

getCurrencyIDs

No WebService-Method! gets the currency ids of current shop.

Syntax
$self->getCurrencyIDs()
Return
$aCurrencyIDs (ref.array.string)
list of shop currency ids

getLanguageIDs

No WebService-Method! gets the language ids of currents shop. result set can be restricted by a list of language codes. if language codes are omitted, all shop language ids will be returned.

Syntax
$self->getLanguageIDs( $aLanguageCodes )
Input
$aLanguageCodes (ref.array.string)
list of language codes,
subset of shop languages (optional)
Return
$aLanguageIDs (ref.array.int)
list of shop language ids (or subset)

getServiceTypesUrn

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

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

getServiceUrn

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

Syntax
$Service->getServiceUrn();
Return
$TypesUrn (string)
web service urn

getShopTypesUrn

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

Syntax
$Service->getShopTypesUrn();
Return
$TypesUrn (string)
web service shop types urn

loadShopObject

loads the object specified by object path and verifies that is exists, belongs to the current shop and is an instance of a certain class. Raises an error if any condition is not fulfilled. Returns the object if all tests passed.

Syntax
$Object = $self->loadShopObject( $Path, $ClassAlias )
Input
$Path (string)
object path to load
$ClassAlias (string)
alias of a class (optional)
Return
$Object (object)
object

loadTaxArea

loads the tax area object by path and verifies that is exists, belongs to the given shop and is an instance of a certain class. Raises an error if any condition is not fulfilled. Returns the object if all tests passed.

Syntax
$Object = $self->loadTaxArea( $Shop, $Path )
Input
$Shop (shop object)
shop
$Path (string)
object path to load
Return
$Object (object)
tax area object

loadTaxClass

loads the tax class object by path and verifies that is exists, belongs to the given shop and is an instance of a certain class. Raises an error if any condition is not fulfilled. Returns the object if all tests passed.

Syntax
$Object = $self->loadTaxClass( $Shop, $Path )
Input
$Shop (shop object)
shop
$Path (string)
object path to load
Return
$Object (object)
tax class object

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

object

Override method object from BaseShopService. Returns the base object on which the WebService will act. The 'Site' attribute (Shop) of the web service user will be used as base object.

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

setAddress

No WebService-Method! Sets address of an object (for create and update users, customers, etc).

Syntax
$self->setAddress( $object, $hAddress )
Input
$object (object)
object to update
$hAddress (ref.hash)
address fields
  • DisplayName - string
  • AddressExtension - string
  • Street - string
  • Street2 - string
  • Zipcode - string
  • City - string
  • State - string
  • CountryID - integer
  • EMail - string
  • Phone - string
  • Fax - string
  • Salutation - string
  • Title - string
  • FirstName - string
  • MiddleName - string
  • LastName - string
  • EMailPrivate - string
  • EMailBusiness - string
  • PhonePrivate - string
  • PhoneBusiness - string
  • PhoneCell - string
  • Gender - integer
  • Company - string
  • Department - string
  • JobTitle - string
  • VATID - string
  • BankCode - string
  • BankName - string
  • BankAccountNo - string
  • BankAccountHolder - string
  • URL - string
  • VerifiedOn - datetime-string
  • Birthday - datetime-string
$AddressType (string)
'BillingAddress' or 'ShippingAddress'

setAddressNamed

No WebService-Method! Sets address of an object (for create and update users, customers, etc).

Syntax
$self->setAddressNamed( $object, $hAddress )
Input
$object (object)
object to update
$hAddress (ref.hash)
address fields
  • Alias - string
  • DisplayName - string
  • AddressExtension - string
  • Street - string
  • Street2 - string
  • Zipcode - string
  • City - string
  • State - string
  • CountryID - integer
  • EMail - string
  • Phone - string
  • Fax - string
  • Salutation - string
  • Title - string
  • FirstName - string
  • MiddleName - string
  • LastName - string
  • EMailPrivate - string
  • EMailBusiness - string
  • PhonePrivate - string
  • PhoneBusiness - string
  • PhoneCell - string
  • Gender - integer
  • Company - string
  • Department - string
  • JobTitle - string
  • VATID - string
  • BankCode - string
  • BankName - string
  • BankAccountNo - string
  • BankAccountHolder - string
  • URL - string
  • VerifiedOn - datetime-string
  • Birthday - datetime-string
$AddressType (string)
'BillingAddress' or 'ShippingAddress'

setAddressesNamed

No WebService-Method! set addresses of user.

Syntax
$self->setAddressesNamed( $user, $ahAddresses )
Input
$address (object)
address object

soapAdditionalAddressesNamed

No WebService-Method! gets address soap objects of user adresses.

Syntax
$self->soapAdditionalAddressesNamed( $object, $aInAttributes )
Input
$address (object)
address object
$aInAttributes (ref.array)
additional attributes

soapAddress

No WebService-Method! gets an soap object of passed address.

Syntax
$self->setAddressNamed( $object, $hAddress )
Input
$address (object)
address object
$aInAttributes (ref.array)
additional attributes

soapAddressNamed

No WebService-Method! gets an soap object of passed address within alias.

Syntax
$self->soapAddressNamed( $object, $hAddress )
Input
$address (object)
address object
$aInAttributes (ref.array)
additional attributes

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