Thank you , thank you, thank you - I cant thank you enough number of times for the example.

I had probably looked at that piece of code 4-5 times yet it didn't strike me as the relevant.

So I reviewed what POE is doing in the sub TransactionDone section in http://cpansearch.perl.org/src/APOCAL/POE-Component-Server-SOAP-1.14/lib/POE/Component/Server/SOAP.pm. I also looked at http://cookbook.soaplite.com/#changing%20method%20name%20in%20response including the discussion section and came up with the following cgi which worked perfectly.

use SOAP::Transport::HTTP; my $server = new SOAP::Transport::HTTP::CGI ->serializer(MySerializer->new) ->dispatch_to('Demo') ->handle(); BEGIN { package MySerializer; @MySerializer::ISA = qw/SOAP::Serializer/; sub envelope { $_[2] = SOAP::Data->name($_[2])->uri($_[0]->uri()) if +$_[1] =~ /^(?:method|response)$/; shift->SUPER::envelope(@_); } } package Demo; use SOAP::Lite; sub hi { return 'Hello'; }

After that got working perfectly I had to do the following to get it all working under mod_perl

1. Added a Location section as follows

<Location /session> Order Deny,Allow SetHandler perl-script PerlHandler SOAP::Apache </Location>
2. Added the following in my startup handler
package MySerializer; @MySerializer::ISA = qw/SOAP::Serializer/; sub envelope { $_[2] = SOAP::Data->name($_[2])->uri($_[0]->uri()) if $_[1] =~ + /^(?:method|response)$/; shift->SUPER::envelope(@_); } package SOAP::Apache; use SOAP::Transport::HTTP; my $server = SOAP::Transport::HTTP::Apache ->serializer(MySerializer->new) -> dispatch_to(... ... ...); sub handler { $server->handler(@_) } 1;
Currently the XML looks great under SOAP::Trace - will have more feedback tomorrow after the .Net client gives it a shot.

Again thanks a lot for guiding me.


In reply to Re^2: Adding namespace in Method Response by inzoik
in thread Adding namespace in Method Response by inzoik

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.