[Xml-compile] XML-Compile-0.96 & XML-Compile-SOAP-0.78.: dateTime element missing

Mark Overmeer mark at overmeer.net
Sat Nov 8 20:16:42 GMT 2008


* Allan Wind (allan at insurancedesk.com) [081108 17:32]:
> On Sat, Nov 8, 2008 at 6:46 AM, Mark Overmeer <solutions at overmeer.net> wrote:
> > Please send me the actual WSDL and (extract of the real) code.
> > Did you try to produce a perl template example for the type?
> 
> Minimal example attached.

This is not the idea behind the module:

  my $schema = XML::Compile::Schema->new($path);
  my $writer = $schema->compile(WRITER =>
    '{https://www.efinancial.net/AddLeadService/}AddLeadWithUser');
  my $element = XML::LibXML::Document->new('1.0', 'UTF-8');
  my $document = $writer->($element, \%data);

  my $wsdl = XML::Compile::WSDL11->new($path);
  my $AddLeadWithUser = $wsdl->compileClient(port => 'AddLeadServiceSoap',
     operation => 'AddLeadWithUser');
  my ($result, $trace) = $AddLeadWithUser->(body => $document);

because you could provide the data directly to the WSDL handler.  Besides,
your message part is named 'parameters', not 'body'.

  my $wsdl = XML::Compile::WSDL11->new($path);
  my $AddLeadWithUser = $wsdl->compileClient(port => 'AddLeadServiceSoap',
     operation => 'AddLeadWithUser');
  my ($result, $trace) = $AddLeadWithUser->(parameters => \%data);

Actually, the last is an abbreviation, only allowed because the message
body has only one part named 'parameters'.  So, this is

  my ($result, $trace) = $AddLeadWithUser->(Body => {parameters => \%data} );

Even this should work

  my ($result, $trace) = $AddLeadWithUser->(%data);

The complaint you see is about 'dob' because the whole HASH for parameters
was missing.  Therefore the first non-optional value to be produced casts
the error; in this case 'dob'.
-- 
Regards,
               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
drs Mark A.C.J. Overmeer                                MARKOV Solutions
       Mark at Overmeer.net                          solutions at overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net




More information about the Xml-compile mailing list