+ Start a Discussion

Assignment Rule and RecordType Problem

We have two recordtypes in cases. While creating a new case, I am passing recordtype in the create call and also trying to assign it to a queue using an assignment rule through API.
My problem is if I try to do both then the assignment rule kicks in but the recordtype is ignored. If I remove the assignment rule then recordtype kicks in.
I am not sure what my problem is. Here is the code I am using for Assignment Rules:
 my $uri   = "urn:enterprise.soap.sforce.com" ;
 my $autoassign = SOAP::Header->name('autoassign' => 'true' );
 my $assign_hdr = SOAP::Header->name('AssignmentRuleHeader' => \$autoassign )->uri($uri);
 my $r = $client->call($method =>
                SOAP::Data->name('sObjects' => \SOAP::Data->value(@elems))
                          ->attr( { 'xsi:type' => 'sfons:'.$type } ),
And here is how I am passing RecordType:
 $result = $port->create('type'  => 'Case',
 'Subject'                       => ['XXXX','xsd:string'],
 'Status'                        => ['New','xsd:string'],
 'Origin'                        => ['Other','xsd:string'],
 'RecordTypeId'           => [$record_type,'sforce:ID'],
What am I doing wrong here?