Hi, hoping someone can help move me along

What am I doing wrong with the $in data? Why am I unable to receive the entire payload?

I've been playing with XML::Compile::WSDL11 the last few weeks and have got my head around a basic WSDL to define the service. No problem in building out each service but do have an issue receiving the data from the client. I'm using soapUI3.5.1 to test and the response I expect is returned fine but data at the server end isn't. I expect to receive this:

$VAR1 = { 'hostname' => 'host123' 'disk' => '500' 'cpu' => '4' 'memory' => '16' };
but instead I only receive this
$VAR1 = { 'memory' => '16' };
Key part of the code is pretty much as per the examples provided with XML::Compile

use warnings; use strict; my $serverhost = 'myserver.net'; my $serverport = '38383'; my $wsdl_filename = 'my.wsdl'; use XML::Compile::SOAP::Daemon::NetServer; use XML::Compile::WSDL11; use XML::Compile::SOAP11; use XML::Compile::Util qw/pack_type/; sub sendData($$$); my $daemon = XML::Compile::SOAP::Daemon::NetServer->new(); my $wsdl = XML::Compile::WSDL11->new($wsdl_filename); my %callbacks = ( sendData => \&sendData ); $daemon->operationsFromWSDL( $wsdl, callbacks => \%callbacks ); $daemon->setWsdlResponse($wsdl_filename); print "Starting daemon PID=$$ on $serverhost:$serverport\n"; $daemon->run ( name => 'NamesService', host => $serverhost, port => $serverport, # Net::Server::PreFork parameters min_servers => 1, max_servers => 1, min_spare_servers => 0, max_spare_servers => 0 ); sub sendData($$$) { my ($server, $in, $request) = @_; trace join '', 'sendData', Dumper $in; if( open OUT, '>', '/tmp/data.txt' ) { print OUT Dumper $in; print OUT Dumper $request; close OUT; } # 'return' hash matched to message part response in WSDL return +{ Return => "OK" }; }

The key part of my WSDL looks like so

<message name="sendData"> <part name="hostname" element="xsd:string"/> <part name="disk" element="xsd:string"/> <part name="cpu" element="xsd:string"/> <part name="memory" element="xsd:string"/> </message>
Therefore sending the following payload to my server
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envel +ope/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <soapenv:Header/> <soapenv:Body> <xs:string>host123</xs:string> <xs:string>500</xs:string> <xs:string>4</xs:string> <xs:string>16</xs:string> </soapenv:Body> </soapenv:Envelope>
should result in the follow Perl hash being output to my debug file /tmp/data.txt
$VAR1 = { 'hostname' => 'host123' 'disk' => '500' 'cpu' => '4' 'memory' => '16' };
It doesn't though and instead I only receive this
$VAR1 = { 'memory' => '16' };
Although the $request quite clearly has the data in it
$VAR1 = bless( { '_protocol' => 'HTTP/1.1', '_content' => '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlso +ap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <soapenv:Header/> <soapenv:Body> <xs:string>host123</xs:string> <xs:string>500</xs:string> <xs:string>4</xs:string> <xs:string>16</xs:string> </soapenv:Body> </soapenv:Envelope>', .. .. ..
What am I doing wrong with the $in data?

In reply to Processing request from XML::Compile by agentorange

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.