< previous
index

Further processing

next >

Now, there are quite a lot of unprocessed "any" and "anyAttribute" components in the tree, which still need to be translated. That is simple, because (although the spec doesn't tell us) we know exactly what to expect. Example:

   # extract from the beautified dumper output
   $op =
    { binding =>
      { name      => 'StockQuoteSoapBinding'
      , operation =>
          [ { name  => 'GetLastTradePrice'
            , input => { '{http://schemas.xmlsoap.org/wsdl/soap/}body' => [XMLNODES] }
              ...
            }
          ] ...
      }
    , bindOperation => $op->{binding}{operation}[0],
      ...
    };

   # we know that there is only one SOAP spec (1.1) related to WSDL (1.1)
   my $soapns = 'http://schemas.xmlsoap.org/wsdl/soap/';  # constant name-space
   $wsdl->schemas->importSchema($soapns);

   my $type   = "{$soapns}body";                          # constant body type
   my $reader = $wsdl->schemas->compile(READER => $type);

   if(my $input = $op->{bindOperation}{input}{$type})
   {   my @body   = map { $reader->($_) } @$input;
       ...
   }

Gladly, this is hidden for you as well.


YAPC::EU 2007 Vienna, Presentation of XML::Compile second part, by Mark Overmeer.