view release on metacpan or search on metacpan
! #74577 work around/fixes for success with MS WS https/compressed
! #74308 SOAP-Lite fails for operations with period in name
! #73802 client did not set the encoding of the soap-envelope to 'iso-8859-1' in HTTP-request
! #75019 HTTP server doesn't process PIPE signal
! #72836 Processing a SOAP 1.2 request breaks the next SOAP 1.1 response
! #70381 SOAP-Lite performance
! #53375 comments after <?xml .. >
! #63693 Uninitalized value (again)
! #37360 Use of uninitialized variables in SOAP tests
! fixed encoding in xmlrpc keys
! #15176 problems with SOAP::Header ->value
0.714
Moved SOAP::Transport::TCP into SOAP-Transport-TPC distribution
! #70329 - not generating attributes properly (deleting id attribute)
0.713
! #52637 error sending a request in perl 5.10.0 containing utf-8 data using the string data type
! #48775 Small bug in SOAP::Packager
! #51178 Emailing: SOAP-Lite-0.710.10.patch
! #55962 Spelling errors
! #52015 defined(%hash) deprecated in Perl 5.11
! #63693 Uninitalized value
+ added interactive Makefile.PL for CPAN installation
0.38 Thu Oct 5 22:06:20 2000
! fixed namespace for base64 encoding
! fixed security problem on server side, upgrade is highly
recommended
+ added HTTPS/SSL support
+ added SMTP client implementation
+ added POP3 server implementation
+ added support for Basic/Digest server authentication
+ added support for header(s) on client/server side with SOAP::Header
+ added Array and SOAPStruct for interoperability with ApacheSOAP
+ added generic class for server support SOAP::Server
+ added Actor attribute
+ added more examples, documentation and tests (88 for now)
0.36 Sun Sep 24 20:12:10 2000
! fixed output parameters autobinding
+ added mod_perl server implementation
+ added recognizing all simple types mentioned in specification
+ added support for 'hex' type
this now.
OVERVIEW OF CLASSES AND PACKAGES
lib/SOAP/Lite.pm
SOAP::Lite - Main class provides all logic
SOAP::Transport - Transport backend
SOAP::Data - Data objects
SOAP::Header - Header Data Objects
SOAP::Serializer - Serializes data structures to SOAP messages
SOAP::Deserializer - Deserializes SOAP messages into SOAP::SOM
objects
SOAP::SOM - SOAP Message objects
SOAP::Constants - Provides access to common constants and defaults
examples/forms/style.cgi view on Meta::CPAN
use SOAP::Transport::HTTP;
SOAP::Transport::HTTP::CGI
-> dispatch_to('Style')
-> handle;
package Style;
sub echo {
return SOAP::Data->name(echo => $_[1]),
SOAP::Header->name('html:style' => <<EOS)->uri('http://www.w3.org/Profiles/XHTML-transitional');
echo { display: block; color: red; }
EOS
}
lib/SOAP/Data.pod view on Meta::CPAN
$elem = SOAP::Data->name("myElement" => "myValue")
->attr( { 'xmlns:foo2' => 'urn:Foo2',
'xmlns:foo3' => 'urn:Foo3' } );
This will produce the following XML:
<myElement xmlns:foo2="urn:Foo2" xmlns:foo3="urn:Foo3">myValue</myElement>
=head1 SEE ALSO
L<SOAP::Header>, L<SOAP::SOM>, L<SOAP::Serializer>
=head1 ACKNOWLEDGEMENTS
Special thanks to O'Reilly publishing which has graciously allowed SOAP::Lite to republish and redistribute large excerpts from I<Programming Web Services with Perl>, mainly the SOAP::Lite reference found in Appendix B.
=head1 COPYRIGHT
Copyright (C) 2000-2004 Paul Kulchenko. All rights reserved.
This library is free software; you can redistribute it and/or modify
lib/SOAP/Fault.pod view on Meta::CPAN
$fault->faultcode(bless { proxy => $ip }, 'Err');
Returns or sets the fault's detail element. Like the actor, this isn't always a required element. Note that fault detail content in a message is represented as tag blocks. Thus, the values passed to this accessor when setting the value are either SOA...
=back
In addition to these methods, the SOAP::Fault package also provides detail as an alias for faultdetail. The former is the actual name of the element with SOAP faults, but the latter name is less ambiguous when regarded with the rest of the SOAP::Lite...
=head1 SEE ALSO
L<SOAP::Data>, L<SOAP::Header>, L<SOAP::SOM>
=head1 ACKNOWLEDGEMENTS
Special thanks to O'Reilly publishing which has graciously allowed SOAP::Lite to republish and redistribute large excerpts from I<Programming Web Services with Perl>, mainly the SOAP::Lite reference found in Appendix B.
=head1 COPYRIGHT
Copyright (C) 2000-2004 Paul Kulchenko. All rights reserved.
This library is free software; you can redistribute it and/or modify
lib/SOAP/Header.pod view on Meta::CPAN
# Copyright (C) 2000-2003 Paul Kulchenko (paulclinger@yahoo.com)
# SOAP::Lite is free software; you can redistribute it
# and/or modify it under the same terms as Perl itself.
#
# ======================================================================
=pod
=head1 NAME
SOAP::Header - similar to SOAP::Data elements, a SOAP::Header object simply is encoded in the SOAP Header block
=head1 DESCRIPTION
Objects instantiated from the SOAP::Header class are functionally the same as SOAP::Data objects, and as such share all the methods from that class. The distinction may be cosmetic, but it is present so that applications may more easily distinguish h...
=head1 SEE ALSO
L<SOAP::Data>
=head1 ACKNOWLEDGEMENTS
Special thanks to O'Reilly publishing which has graciously allowed SOAP::Lite to republish and redistribute large excerpts from I<Programming Web Services with Perl>, mainly the SOAP::Lite reference found in Appendix B.
=head1 COPYRIGHT
lib/SOAP/Lite.pm view on Meta::CPAN
my $self = UNIVERSAL::isa($_[0] => __PACKAGE__)
? shift->new()
: __PACKAGE__->new();
(@_)
? ($self->{_signature} = shift, return $self)
: (return $self->{_signature});
}
# ======================================================================
package SOAP::Header;
use vars qw(@ISA);
@ISA = qw(SOAP::Data);
# ======================================================================
package SOAP::Serializer;
use SOAP::Lite::Utils;
use Carp ();
use vars qw(@ISA);
lib/SOAP/Lite.pm view on Meta::CPAN
return $self->xmlize($encoded);
}
sub envelope {
SOAP::Trace::trace('()');
my $self = shift->new;
my $type = shift;
my(@parameters, @header);
for (@_) {
# Find all the SOAP Headers
if (defined($_) && ref($_) && UNIVERSAL::isa($_ => 'SOAP::Header')) {
push(@header, $_);
}
# Find all the SOAP Message Parts (attachments)
elsif (defined($_) && ref($_) && $self->context
&& $self->context->packager->is_supported_part($_)
) {
$self->context->packager->push_part($_);
}
# Find all the SOAP Body elements
else {
lib/SOAP/Lite.pm view on Meta::CPAN
sub valueof {
my $self = shift;
local $self->{_current} = $self->{_current};
$self->match(shift) if @_;
return wantarray
? map {o_value($_)} @{$self->{_current}}
: @{$self->{_current}} ? o_value($self->{_current}->[0]) : undef;
}
sub headerof { # SOAP::Header is the same as SOAP::Data, so just rebless it
wantarray
? map { bless $_ => 'SOAP::Header' } shift->dataof(@_)
: do { # header returned by ->dataof can be undef in scalar context
my $header = shift->dataof(@_);
ref $header ? bless($header => 'SOAP::Header') : undef;
};
}
sub dataof {
my $self = shift;
local $self->{_current} = $self->{_current};
$self->match(shift) if @_;
return wantarray
? map {$self->_as_data($_)} @{$self->{_current}}
: @{$self->{_current}}
lib/SOAP/Lite.pm view on Meta::CPAN
&& UNIVERSAL::isa($parameters[0] => $class)
? do {
my $object = shift @parameters;
SOAP::Server::Object->object(ref $class
? $class
: $object
)->$method_name(SOAP::Server::Object->objects(@parameters)),
# send object back as a header
# preserve name, specify URI
SOAP::Header
->uri($SOAP::Constants::NS_SL_HEADER => $object)
->name($request->dataof($som->method.'/[1]')->name)
} # end do block
# SOAP::Dispatcher will plug-in here as well
# $handler->dispatch(SOAP::Server::Object->objects(@parameters)
: $class->$method_name(SOAP::Server::Object->objects(@parameters)) );
}; # end eval block
SOAP::Trace::result(@results);
lib/SOAP/Lite.pm view on Meta::CPAN
sub create; *create = \&new; # make alias. Somewhere 'new' is registered keyword
sub soap; *soap = \&new; # also alias. Just to be consistent with .xmlrpc call
sub xmlrpc { required; XMLRPC::Lite->new(@_) }
sub server { required; shift->new(@_) }
sub data { SOAP::Data->new(@_) }
sub header { SOAP::Header->new(@_) }
sub hash { +{@_} }
sub instanceof {
my $class = shift;
die "Incorrect class name" unless $class =~ /^(\w[\w:]*)$/;
eval "require $class";
$class->new(@_);
}
lib/SOAP/Lite.pm view on Meta::CPAN
=over
=item F<lib/SOAP/Lite.pm>
L<SOAP::Lite> - Main class provides all logic
L<SOAP::Transport> - Transport backend
L<SOAP::Data> - Data objects
L<SOAP::Header> - Header Data Objects
L<SOAP::Serializer> - Serializes data structures to SOAP messages
L<SOAP::Deserializer> - Deserializes SOAP messages into SOAP::SOM objects
L<SOAP::SOM> - SOAP Message objects
L<SOAP::Constants> - Provides access to common constants and defaults
L<SOAP::Trace> - Tracing facilities
lib/SOAP/SOM.pod view on Meta::CPAN
=item dataof(node)
$resobj = $som->dataof('[1]');
Performs the same operation as the earlier valueof method, except that the data is left in its L<SOAP::Data> form, rather than being deserialized. This allows full access to all the attributes that were serialized along with the data, such as namespa...
=item headerof(node)
$resobj = $som->headerof('[1]');
Acts much like dataof, except that it returns an object of the L<SOAP::Header> class (covered later in this chapter), rather than SOAP::Data. This is the preferred interface for manipulating the header entities in a message.
=item namespaceuriof(node)
$ns = $som->namespaceof('[1]');
Retrieves the namespace URI that governs the requested node. Note that namespaces are inherited, so this method will return the relevant value, even if it derives from a parent or other ancestor node.
=back
The following methods provide more direct access to the message envelope. All these methods return some form of a Perl value, most often a hash reference, when called. Context is also relevant: in a scalar context only the first matching node is retu...
lib/SOAP/Serializer.pod view on Meta::CPAN
=item new(optional key/value pairs)
$serialize = SOAP::Serializer->new( );
This is the constructor method for the class. In addition to creating a basic object and initializing it with default values, the constructor can also take names and values for most of the accessor methods that the class supports.
=item envelope(method, data arguments)
$serialize->envelope(fault => $fault_obj);
Provides the core purpose for the SOAP::Serializer class. It creates the full SOAP envelope based on the input passed in to it. The data arguments passed in the list of parameters to the method are divided into two sublists: any parameters that are L...
=item context
$serialize->context->packager();
This provides access to the calling context of C<SOAP::Serializer>. In a client side context the often means a reference to an instance of SOAP::Lite. In a server side context this means a reference to a SOAP::Server instance.
=over
=item method
lib/SOAP/Test.pm view on Meta::CPAN
print STDERR "Autobinding of output parameters test(s)...\n";
$s->uri('urn:/My/Parameters');
my $param1 = 10;
my $param2 = SOAP::Data->name('myparam' => 12);
my $result = $s->autobind($param1, $param2)->result;
ok($result == $param1 && $param2->value == 24);
print STDERR "Header manipulation test(s)...\n";
$a = $s->addheader(2, SOAP::Header->name(my => 123));
ok(ref $a->header && $a->header->{my} eq '123123');
ok($a->headers eq '123123');
print STDERR "Echo untyped data test(s)...\n";
$a = $s->echotwo(11, 12);
ok($a->result == 11);
print STDERR "mustUnderstand test(s)...\n";
$s->echo(SOAP::Header->name(somethingelse => 123)
->mustUnderstand(1));
ok($s->call->faultstring =~ /[Hh]eader has mustUnderstand attribute/);
if ($proxy =~ /^http/) {
ok($s->transport->status =~ /^500/);
} else {
skip('No Status checks for non http protocols on server side' => undef);
}
$s->echo(SOAP::Header->name(somethingelse => 123)
->mustUnderstand(1)
->actor('http://notme/'));
ok(!defined $s->call->fault);
print STDERR "dispatch_from test(s)...\n";
eval "use SOAP::Lite
uri => 'http://my.own.site.com/My/Examples',
dispatch_from => ['A', 'B'],
proxy => '$proxy',
; 1" or die;
t/02-payload.t view on Meta::CPAN
$a = { a => 1 };
$serialized = SOAP::Serializer->namespaces({})->serialize($a);
ok($serialized =~ m!<c-gensym(\d+)><a xsi:type="xsd:int">1</a></c-gensym\1>!);
}
{ # check header/envelope serialization/deserialization
print "Header/Envelope serialization/deserialization test(s)...\n";
$serialized = SOAP::Serializer->method( # same as ->envelope(method =>
'mymethod', 1, 2, 3,
SOAP::Header->name(t1 => 5)->mustUnderstand(1)->uri('http://namespaces.soaplite.com/headers'),
SOAP::Header->name(t2 => 7)->mustUnderstand(2),
);
$deserialized = SOAP::Deserializer->deserialize($serialized);
my $t1 = $deserialized->match(SOAP::SOM::header)->headerof('t1');
my $t2 = $deserialized->dataof('t2');
my $t3 = eval { $deserialized->headerof(SOAP::SOM::header . '/{http://namespaces.soaplite.com/headers}t3'); };
ok(!$@ && !defined $t3);
my @paramsin = $deserialized->paramsin;
t/02-payload.t view on Meta::CPAN
ok($root->{c1}->{a}->{b} == 2);
ok($root->{c2}->{a}->{b} == 2);
}
{ # Serialization of multirefs shared between Header and Body
print "Serialization of multirefs shared between Header and Body test(s)...\n";
$a = { b => 2 };
print $serialized = SOAP::Serializer->autotype(0)->method(a => SOAP::Header->value($a), $a);
print "\n";
print '<soap:Header><c-gensym\d+ href="#ref-(\d+)" /></soap:Header><soap:Body><a><c-gensym\d+ href="#ref-\1" /></a><c-gensym(\d+) id="ref-\1"><b>2</b></c-gensym\2></soap:Body>', "\n";
ok($serialized =~ m!<soap:Header><c-gensym\d+ href="#ref-(\d+)" /></soap:Header><soap:Body><a><c-gensym\d+ href="#ref-\1" /></a><c-gensym(\d+) id="ref-\1"><b>2</b></c-gensym\2></soap:Body>!);
}
{ # Deserialization with typecast
print "Deserialization with typecast test(s)...\n";
my $desc = 0;
my $typecasts = 0;
t/24-wsdl.t view on Meta::CPAN
print "Service description static stub with import test(s)...\n";
net_xmethods_services_stockquote_StockQuoteService->import(':all');
ok(getQuote('MSFT') > 1);
ok(defined net_xmethods_services_stockquote_StockQuoteService->self);
ok(net_xmethods_services_stockquote_StockQuoteService->self->call);
# ok, now we'll test for passing SOAP::Data and SOAP::Headers as a parameters
my @params;
{
package TestStockQuoteService;
@TestStockQuoteService::ISA = 'net_xmethods_services_stockquote_StockQuoteService';
sub call { shift; @params = @_; new SOAP::SOM }
}
my @testparams = (SOAP::Data->name(param1 => 'MSFT'),
SOAP::Data->name('param2'),
SOAP::Header->name(header1 => 'value'));
TestStockQuoteService->new->getQuote(@testparams);
ok($params[1]->value->name eq 'param1');
ok($params[2]->name eq 'param2');
ok(ref $params[3] eq 'SOAP::Header' && $params[3]->name eq 'header1');
}
t/Issues/rt15176.t view on Meta::CPAN
use strict;
use warnings;
use Test::More tests => 1;
use SOAP::Lite;
# When setting a value that contains wide characters (> U+00ff), it tries to encode as Base64 but then fails
eval {
my $header = SOAP::Header->value("\N{U+00ff}");
};
ok (!@$);