The VersionSamples example also shows how to set up the SOAP request with all the required information.
Let’s walk through the important parts of the Perl code.
We’ll start with lines 25-26.
my $standardService = SOAP::Lite -> service($BASE_URL.'soap/standard?wsdl')
->proxy($BASE_URL.'soap/standard');
These two lines define the service to use. For this example, version is part of the Standard service.
You also need to specify the header (as indicated in SdHeader). Lines 28-31 do this, as follows:
my $header = SOAP::Header->name('SdHeader' =>
\SOAP::Header->value(
SOAP::Header->name(clientID => $clientID)->type('')
))->attr({xmlns => 'http://www.sirsidynix.com/xmlns/common/header'});
These lines specify that you are creating a header called SdHeader. For this header, we only want to send the clientID. In the final line, you reference the header namespace.
In the next set of lines (33-36), you specify the request and the namespace.
my $method = SOAP::Data
->name('VersionRequest')
->prefix('stan')
->uri('http://schemas.sirsidynix.com/symws/standard');
VersionRequest is the name of the request. The prefix must correspond to the service type (adm for admin, pat for patron, sec for security, or stan for standard). Last, you qualify the namespace. In this case, the version operation is part of the standard service.
Next, you create the request and send it to a variable for the response.
Finally, you iterate through each set of responses in lines 51-53:
foreach($response->dataof('//VersionResponse/version/*')) {
print $_->name . ": " . $_->value . "\n";
}
In the foreach loop statement, you specify the response variable and only look at the requested data in the version node of the returned XML. The print statement merely displays the name/value pair information for each version sub-node.
See the VersionSamples example for the rest of the code.
© 2009-2012 SirsiDynix