sub getComplexObj { my $_count = 12 my $mike = { 'Count'=> SOAP::Data->new( name => 'Count', value => $_count, type => 'xsd:int' )->attr({ 'xmlns' => $MC_XMLNS }), 'test' => SOAP::Data->new( name => 'test', value => 'test string', type =>'xsd:string' )->attr({ 'xmlns'=> $MC_XMLNS })}; my $foo = SOAP::Data->new( name => 'return', value =>bless{ $self ,('compObj')->attr({ 'xsi:type' => typens:'compObj' })} )->attr({ 'xmlns' => $MC_XMLNS }); return $foo; }