My OOP is limited to a C++ course I took 11 years ago and that knowledge has gradually rusted. Currently I program PHP with mySQL, Transact SQL, DB2 and a little Javascript, today I'm trying to "consume" a web service.
I used WSDL2PHP to create GeneWrapperWebService.php (below) and my ultimate aim is to extract the "fileName" and "fileLink" from the object. I plan to deal with error handling after I have found a way to extract the data, honest. The number of fileNames is variable so presumably an array of some sort.
How to get from the WSDL to the fileNames so that I can display a list on the client browsers?
<?php
class TestAttachment {
public $itemNumber; // string
}
class TestAttachmentResponse {
public $TestAttachmentResult; // TestAttachmentResult
}
class TestAttachmentResult {
public $any; // <anyXML>
}
class getAttachmentInfo {
public $itemNumber; // string
public $isFileContentRequired; // boolean
}
class getAttachmentInfoResponse {
public $getAttachmentInfoResult; // result
}
class result {
public $error; // boolean
public $errorMessage; // string
public $item; // itemInfo
}
class itemInfo {
public $itemNumber; // string
public $revisions; // revisionInfo
}
class revisionInfo {
public $attachments; // attachmentInfo
public $revision; // string
}
class attachmentInfo {
public $content; // base64Binary
public $fileDescription; // string
public $fileLink; // string
public $fileName; // string
public $fileType; // string
public $folderName; // string
}
/**
GeneWrapperWebService class
@author {author}
@copyright {copyright}
@package {package}
/
class GeneWrapperWebService extends SoapClient {
private static $classmap = array(
'TestAttachment' => 'TestAttachment',
'TestAttachmentResponse' => 'TestAttachmentResponse',
'TestAttachmentResult' => 'TestAttachmentResult',
'getAttachmentInfo' => 'getAttachmentInfo',
'getAttachmentInfoResponse' => 'getAttachmentInfoResponse',
'result' => 'result',
'itemInfo' => 'itemInfo',
'revisionInfo' => 'revisionInfo',
'attachmentInfo' => 'attachmentInfo',
);
public function GeneWrapperWebService($wsdl = "http://isdev02:7777/GeneWrapperWebService.asmx?WSDL", $options = array()) {
foreach(self::$classmap as $key => $value) {
if(!isset($options['classmap'][$key])) {
$options['classmap'][$key] = $value;
}
}
parent::__construct($wsdl, $options);
}
/**
@ TestAttachment $parameters
@return TestAttachmentResponse
*/
public function TestAttachment(TestAttachment $parameters) {
return $this->__soapCall('TestAttachment', array($parameters), array(
'uri' => 'http://isdev02/',
'soapaction' => ''
)
);
}
/**
@ getAttachmentInfo $parameters
@return getAttachmentInfoResponse
*/
public function getAttachmentInfo(getAttachmentInfo $parameters) {
return $this->__soapCall('getAttachmentInfo', array($parameters), array(
'uri' => 'http://isdev02/',
'soapaction' => ''
)
);
}
}
?>
hirsutus.