
1124
DEVELOPING
COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
Las
t
upda
te
d 8/5/2010
3
Invoke the class with required parameters.
The following example shows a section of a PHP page that adds a border to an image:
$input = new AddBorder();
//Fill in the class fields of $input to match your business logic
$input->serviceusername = "myuser";
$input->servicepassword = "mypassword";
$input->source = "http://myPHPSite/Images/image.jpg";
$input->thickness = "30";
$input->color = "blue";
$input->bordertype = "";
// call the operation
$response = $proxy->AddBorder($input);
In this code snippet,
serviceusername
is the user name set in the ColdFusion administrator with the permission to access the specific
service being requested.
servicepassword
is the password set for the service user name.
source
is the source URL of the image in the PHP server.Other attributes are the same as the
ImageAddborder()
ColdFusion function.
Batch operation on Image:
The following code performs multiple operations on an uploaded image such as
batchOperation()
to crop an image
and add a border to it.
$input = new batchOperation();
//TODO: fill in the class fields of $input to match your business logic
//Crop
$element1 = new Element();
$element2 = new Element();
$element3 = new Element();
$element4 = new Element();
$elementArray1 = new ArrayOf_xsd_anyType();
$element1->key = 'x';
$element1->value = '10';
$element2->key = 'y';
$element2->value = '10';
$element3->key = 'width';
$element3->value = '200';
$element4->key = 'height';
$element4->value = '200';
$elementArray1->item[0] = $element1;
$elementArray1->item[1] = $element2;
$elementArray1->item[2] = $element3;
$elementArray1->item[3] = $element4;
$ElementcollectionCrop = new Elementcollection();
$ElementcollectionCrop->key = 'Crop';
$ElementcollectionCrop->value = $elementArray1;
//AddBorder
$element5 = new Element();
$element6 = new Element();