Subject: | Implementation of a describeSObjects method |
I have implemented describeSObjects for WWW::Salesforce. Please see the
attached code for details.
The method takes a hash as its arguments, with the key type and the
value of an array reference containing Salesforce object names. I have
used this approach to remain consistent with the rest of the code.
Tom Hukins
Subject: | describeSObjects.pl |
sub describeSObjects {
my $self = shift;
my %in = @_;
if (
!defined $in{type} or
ref $in{type} ne 'ARRAY' or
!scalar @{ $in{type} }
) {
carp "Expected hash with key 'type' containing array reference";
return;
}
my $client = $self->get_client(1);
my $method = SOAP::Data
->name( "describeSObjects" )
->prefix( $SF_PREFIX )
->uri( $SF_URI );
my $r = $client->call(
$method => SOAP::Data->prefix( $SF_PREFIX )
->name( 'sObjectType' )
->value( @{ $in{'type'} } )
->type( 'xsd:string' ),
$self->get_session_header()
);
if ( $r->fault() ) {
carp( $r->faultstring() );
return;
}
return $r;
}