On 5/9/06, Karjala <[EMAIL PROTECTED]> wrote:
While not "SOAP" , I use XML content posts all the time this way from a proprietary application front end in an autohandler.
if ($ENV{'CONTENT_TYPE'} =~ /^text\/xml/)
{
my $xmlRequest = undef;
my $buf;
while($r->read($buf, $ENV{'CONTENT_LENGTH'}))
{
$xmlRequest .= $buf;
};
..verify we received something, parse it, and enjoy.
};
--Rodney
I need to create a SOAP (XML, like XML-RPC) server and was wondering if
it's possible to do that with Mason.
The only issue that seems to be a problem is the following: SOAP
requests are HTTP POST requests whose "body" is XML instead of
some_param=some_value.
Reading Mason's documentation makes me think there might be no way to
access this XML-style content of the HTTP POST request.
See the "common traps" section :
http://www.masonhq.com/docs/manual/Devel.html#common_traps
"Mason calls $r->content itself to read request input, emptying the
input buffer and leaving a trap for the unwary: subsequent calls to
$r->content hang the server. This is a mod_perl ``feature'' that may be
fixed in an upcoming release."
Well, if Mason tries to parse the content as param=value nomatter what
and then empties this content, it seems the XML will disappear. But if
somehow there's a way to prevent Mason from doing that, or if the XML is
stored somewhere else, maybe there is a solution.
Any hints?
Thanks,
- Karjala
While not "SOAP" , I use XML content posts all the time this way from a proprietary application front end in an autohandler.
if ($ENV{'CONTENT_TYPE'} =~ /^text\/xml/)
{
my $xmlRequest = undef;
my $buf;
while($r->read($buf, $ENV{'CONTENT_LENGTH'}))
{
$xmlRequest .= $buf;
};
..verify we received something, parse it, and enjoy.
};
--Rodney

