#!C:/perl/bin/perl -w use strict; use SOAP::Data::ComplexType; package My::Complex; use base qw(SOAP::Data::ComplexType); use constant OBJ_TYPE => 'myns:complex'; use constant OBJ_URI => 'http://my.uri.com'; use constant OBJ_FIELDS => { string_array => [ 'SOAP-ENC:Array', undef, { 'SOAP-ENC:arrayType' => 'string' } ] }; sub new { my $proto = shift; my $class = ref($proto) || $proto; my $data = shift; my $obj_fields = $_[1]; #second param from untouched @_ $obj_fields = defined $obj_fields && ref($obj_fields) eq 'HASH' ? {%{+OBJ_FIELDS}, %{$obj_fields}} : OBJ_FIELDS; my $self = $class->SUPER::new($data, $obj_fields); return bless($self, $class); } my $complex = My::Complex->new({string_array => [ 'text1', 'text2', 'text3' ]}); print $complex->as_xml_data; #### text1 text2 text3