# Creating a Community String Credential
# Refer to API Usage section for how to
# create an instance of SOAP::Lite
# ie $soap_client = new SOAP::Lite ....
# create a network and capture its RII
# see previous example for full example
# $soap_response = $soap_client->createNetwork($new_network_info);
# $new_net_rii = $soap_response->result;
$comm_rii = {
resourceName => 'TestCSCredName',
resourceType => 'COMMUNITY-CREDENTIAL',
resourceKey => undef};
bless $comm_rii, 'ResourceIdentityInfo';
$comm_cred_info = {
id => $comm_rii,
readOnly => 'test-read-only-mod',
readWrite => 'test-read-write-mod'};
bless $comm_cred_info, 'CommunityCredentialInfo';
# build param 0
$comm_param = new SOAP::Data
name => 'in0',
attr => {'xsi:type' => ref($comm_cred_info)},
value => $comm_cred_info;
# build param 1
$net_param = new SOAP::Data
name => 'in1',
attr => {'xsi:type' => ref($new_net_rii)},
value => $new_net_rii;
# Create the credential.
$soap_response =
$soap_client->createCommunityStringCredential($comm_param, $net_param);
if ($soap_response->fault) {
print "\nSOAP fault: ".$soap_response->faultstring."\n";
}
else {
$comm_rii = $soap_response->result;
print "\nNew resourceKey is: ".$comm_rii->{'resourceKey'}."\n";
}