package My::SOAP; use Apache::SOAP; use strict; use vars qw( @ISA $VERSION ); # This class inherits from the Apache::SOAP class and is intended to provide # functionality relating to the SOAP server itself, rather than the exposed # web services. @ISA = qw( SOAP::Transport::HTTP::Apache ); my $server = __PACKAGE__->new; sub new { my $self = shift; unless( ref $self ) { $self = __PACKAGE__->SUPER::new( @_ ); $self->serializer( My::SOAP::Serialiser->new ); # The following on_action handler is intended to make this web service .NET # friendly by modifying the SOAPAction header to fit the form of URI#method # (the form preferred by SOAP::Lite) where the SOAPAction header is of the # form URI/method (that employed by the .NET framework). $self->on_action( sub { ( my $action = shift ) =~ s/^("?)(.*)\1$/$2/; if( $action && $action ne join( '#', @_ ) && $action ne join( '/', @_ ) && ( substr( $_[0], -1, 1 ) ne '/' || $action ne join( '', @_ ))) { $self->action( join '#', @_ ); } } ); } return $self; } 1; __END__