This section provides a tutorial example on testing methods that are available on SOAP::Lite 0.710 client object.
To verify methods listed in the previous tutorial, I wrote this test program,
SOAP_Lite_0_710_Client_Object.pl:
#- SOAP_Lite_0_710_Client_Object.pl
#- Copyright (c) 2009 by Dr. Herong Yang, herongyang.com
#- All rights reserved
#
use SOAP::Lite;
#- Creating a client object with default properties
my $client = SOAP::Lite->new();
#- Sets the proxy object with protocol, server and end point
$client->proxy('http://localhost/');
#- Resets the end point
$client->endpoint('http://localhost/Demo_Service');
#- Sets the service object. It loads the WSDL immediately
#- So don't use it unless the WSDL is available
# $client->service('http://localhost/Demo_Service_WSDL');
#- Turns on the flag to receive raw XML in the response
$client->outputxml(true);
#- Turns on the flag to auto automatically deduce types
#- for the data used in the request message
$client->autotype(true);
#- Turns on the flag to make the request message readable
#- using spaces and line breaks
$client->readable(true);
#- Sets the current namespace with a prefix
$client->ns('http://herongyang.com/', 'hy');
#- Sets SOAP version to 1.2
$client->soapversion('1.2');
#- Sets prefix of the SOAP envelop namespace
$client->envprefix('env');
#- Sets prefix of the SOAP encoding namespace
$client->encprefix('enc');
#- Calls the server and send the request
#- $client->call('GetProfile',"Herong Yang");
#- Prints information with get methods
print "\n\$client: ".$client;
print "\n\$client->transport(): ".$client->transport();
print "\n\$client->serializer(): ".$client->serializer();
print "\n\$client->packager(): ".$client->packager();
print "\n\$client->proxy(): ".$client->proxy();
print "\n\$client->endpoint(): ".$client->endpoint();
print "\n\$client->service(): ".$client->service();
print "\n\$client->outputxml(): ".$client->outputxml();
print "\n\$client->autotype(): ".$client->autotype();
print "\n\$client->readable(): ".$client->readable();
print "\n\$client->default_ns(): ".$client->default_ns();
print "\n\$client->ns(): ".$client->ns();
print "\n\$client->soapversion(): ".$client->soapversion();
print "\n\$client->envprefix(): ".$client->envprefix();
print "\n\$client->encprefix(): ".$client->encprefix();
print "\n\$client->encoding(): ".$client->encoding();
print "\n\$client->typelookup(): ".$client->typelookup();
print "\n\$client->multirefinplace(): ".$client->multirefinplace();
print "\n\$client->parts(): ".$client->parts();
print "\n\$client->on_action(): ".$client->on_action();
print "\n\$client->on_nonserialized(): "
.$client->on_nonserialized();