Subject: | wsdl2perl - prefix option |
Hi,
Thanks for all your work on this resource.
I've attached a minor patch that I applied to wsdl2perl.pl that you
might be interested in. Essentially this resolves the --prefix option in
the way that I *think* was originally intended (the option is documented
in the POD usage but doesn't appear to be implemented).
Cheers,
Ian
wsdl2perl.pl project.wsdl
'element_prefix' => 'MyElements'
'attribute_prefix' => 'MyAttributes'
'typemap_prefix' => 'MyTypemaps'
'type_prefix' => 'MyTypes'
'interface_prefix' => 'MyInterfaces'
'server_prefix' => 'MyServer'
wsdl2perl.pl -prefix 'Project' project.wsdl
'element_prefix' => 'ProjectElements'
'attribute_prefix' => 'ProjectAttributes'
'typemap_prefix' => 'ProjectTypemaps'
'type_prefix' => 'ProjectTypes'
'interface_prefix' => 'ProjectInterfaces'
'server_prefix' => 'ProjectServer'
wsdl2perl.pl -prefix 'Project' -element_prefix 'CustomElements' project.wsdl
'element_prefix' => 'CustomElements'
'attribute_prefix' => 'ProjectAttributes'
'typemap_prefix' => 'ProjectTypemaps'
'type_prefix' => 'ProjectTypes'
'interface_prefix' => 'ProjectInterfaces'
'server_prefix' => 'ProjectServer'
Subject: | wsdl2perl.patch |
13,19c13,19
< prefix => 'My',
< attribute_prefix => undef,
< type_prefix => undef,
< element_prefix => undef,
< typemap_prefix => undef,
< interface_prefix => undef,
< server_prefix => undef,
---
> prefix => undef,
> attribute_prefix => 'MyAttributes',
> type_prefix => 'MyTypes',
> element_prefix => 'MyElements',
> typemap_prefix => 'MyTypemaps',
> interface_prefix => 'MyInterfaces',
> server_prefix => 'MyServer',
94,107d93
< # resolve the default prefix options
< map {
< my $opt_key = $_;
< if ( $opt_key =~ / (\w+) _prefix $/xms # relevant option
< && !$opt{ $opt_key } # that hasn't already been explicitly set
< )
< {
< my $prefix_type = $1;
< $opt{ $opt_key } = $opt{prefix} . # My
< ucfirst( $prefix_type ) . # Typemap
< ( $prefix_type eq 'server' ? '' : 's' ); # s
< }
< } keys %opt;
<