< previous
index

Execute the SOAP client

next >

[describing XML::Compile::SOAP 0.64, 2007/11/27]
After all the automatic preparations above, the only thing to do is to call the compiled routines.

   print $get_price->(tickerSymbol => 'IBM')->{body}{price};

If the SOAP message which is being sent contains multiple body parts or header parts, then you will need to use more parameters in your call. Find all part names which are used for the message in your WSDL document. Call your compiled function explicitly stating which data belongs to which part. All data left-over is stored in the first body part. For instance:

   my $answer = $get_price->
     ( login => { username => $u, password => $p }
     , transaction  => 5
     , tickerSymbol => 'IBM'
     );

The login and transaction are names of parts mentioned in the (fictive) WSDL file. The remains go to the first body part, as ever.

The automatic procedure generation is only possible for document style SOAP. When RPC style SOAP is used, you will need to specify the types explictly: different from Java applications which communicate using SOAP, with Perl we can not be sure that the client produces the data-types which the server is willing to accept.

Both RPC-literal and RPC-encoded are supported, but not discussed here.


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