I am trying to migrate a set of web services to run under Apache::SOAP instead of POE::Component::Server::SOAP and am observing a behavior which has halted the whole process.
use POE; use POE::Component::Server::SOAP; POE::Component::Server::SOAP->new( 'ALIAS' => 'MySOAP', 'ADDRESS' => 'localhost', 'PORT' => 32080, ); POE::Session->create( 'inline_states' => { '_start' => \&setup_service, '_stop' => \&shutdown_service, 'hi' => \&hi, }, ); $poe_kernel->run; exit 0; sub setup_service { my $kernel = $_[KERNEL]; $kernel->alias_set( 'Demo' ); $kernel->post( 'MySOAP', 'ADDMETHOD', 'Demo', 'hi' ); } sub shutdown_service { $_[KERNEL]->post( 'MySOAP', 'DELMETHOD', 'Demo', 'hi'); } sub hi { my $response = $_[ARG0]; my $params = $response->soapbody; $response->content( "Hello" ); $_[KERNEL]->post( 'MySOAP', 'DONE', $response ); } 1;
With SOAP::Trace enabled the soap body for the POE code above was
<namesp1:hiResponse xmlns:namesp1="http://127.0.0.1:32080/"> <s-gensym3 xsi:type="xsd:string">Hello</s-gensym3> </namesp1:hiResponse>
Whereas the Apache::SOAP code below
#!/usr/bin/perl use SOAP::Transport::HTTP; SOAP::Transport::HTTP::CGI ->dispatch_to('Demo') ->handle; package Demo; sub hi { return 'Hello'; } 1;
is generating
<hiResponse xmlns="http://127.0.0.1/Demo"> <s-gensym3 xsi:type="xsd:string">Hello</s-gensym3> </hiResponse>
The above difference is preventing a .Net client from reading the response. Any suggestions or pointers would be highly appreciated.

In reply to 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.