The way that I have done this in the past is to create my own class that inherits from Apache::SOAP and incorporates a new constructor that includes the call to the serializer function.
For example:
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 w
+eb service .NET
# friendly by modifying the SOAPAction header to fit the for
+m of URI#method
# (the form preferred by SOAP::Lite) where the SOAPAction he
+ader 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__
(This code, although slightly modified to protect the innocent, is from an Apache::SOAP server implementation that was developed for interface from .NET solution components and shows one way to implement your own serialiser within Apache::SOAP derived solutions).
perl -le "print unpack'N', pack'B32', '00000000000000000000001000000000'"
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|