view release on metacpan or search on metacpan
v0.71.03
! #35041: SOAP::Lite Passes Decoded Strings to LWP
! #35133: Version Unparsable by ExtUtils::MakeMaker
! #33973: KeepAlive fails to function
! #33773: redefined warnings
! #34514: Subclasses of XMLRPC::Serializer misbehave because of a "ref" call in SOAP::Lite
(actually fixed in 0.71.01, but I forgot to add it to Changes)
0.71.02
! [1942233] Memory leak in 0.69 && 0.71
0.71.01
! #34515: Printing UTF-8 through SOAP::Transport::HTTP throws a warning
! Version numbers updated
! [1904955] Subclassing XMLRPC::Serializer broken
0.71 Feb 2008
- bumped up version. Just curious about commit e-mail.
0.70_08 Feb 25 2008
- bumped up version - accidentally uploaded a ppm to CPAN
0.70_07 Feb 25 2008
+ Added additional callbacks to XML::Parser::Lite and made it work under
(at least) perl5.6.2, 5.8.7, 5.8.8 and 5.10.
Thanks to Adam Leggett.
examples/XML/customxml.pl view on Meta::CPAN
-> valueof('/Envelope/Body');
foreach my $portfolio ($d->Report->Request->Composition->PortfolioDistribution) {
print $portfolio->type, " ", $portfolio->date, "\n";
foreach my $row ($portfolio->Row) {
print " ", $row->Element, " ", $row->Value, "\n";
}
}
__DATA__
<?xml version="1.0" encoding="UTF-8"?>
<Envelope version="1.1">
<Header />
<Body>
<Report>
<Header>
<ClientRef />
<FundCusip>61744J366</FundCusip>
<SepAcctDesc />
</Header>
<Request>
examples/forms/style.html view on Meta::CPAN
<html>
<head><title>SOAP::Lite POST Examples</title></head>
<body>
<h1>SOAP::Lite Examples</h1>
<hr>
<form action="http://services.soaplite.com/style.cgi" method="POST" enctype="multipart/form-data">
<input type="hidden" name="payload" value='<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3...
<input name="echo" value="37.5">
<input type="submit">
</form>
</html>
lib/SOAP/Data.pod view on Meta::CPAN
SOAP::Data->name("someArrayItem" => @array)
->type("SomeObject"))
)->type("ArrayOf_SomeObject") ))
->type("SomeObject");
$response = $client->someMethod($temp_elements);
Will produce the following XML:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:namesp2="http://namespaces.soaplite.com/perl"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<namesp1:someMethod xmlns:namesp1="urn:TemperatureService">
<CallDetails xsi:type="namesp2:SomeObject">
lib/SOAP/Lite.pm view on Meta::CPAN
my $class = $self;
$self = bless {
_level => 0,
_autotype => 1,
_readable => 0,
_ns_uri => '',
_ns_prefix => '',
_use_default_ns => 1,
_multirefinplace => 0,
_seen => {},
_encoding => 'UTF-8',
_objectstack => {},
_signature => [],
_maptype => {},
_bodyattr => {},
_headerattr => {},
_on_nonserialized => sub {Carp::carp "Cannot marshall @{[ref shift]} reference" if $^W; return},
_encodingStyle => $SOAP::Constants::NS_ENC,
_attr => {
"{$SOAP::Constants::NS_ENV}encodingStyle" => $SOAP::Constants::NS_ENC,
},
lib/SOAP/Test.pm view on Meta::CPAN
for (1) {skip('No UTF8 test. No support for pack("U*") modifier' => undef)}
} else {
$s = SOAP::Lite
-> uri('http://my.own.site.com/My/Parameters')
-> proxy($proxy);
my $latin1 = '�ਢ��';
my $utf8 = pack('U*', unpack('C*', $latin1));
my $result = $s->echo(SOAP::Data->type(string => $utf8))->result;
ok(pack('U*', unpack('C*', $result)) eq $utf8 # should work where XML::Parser marks resulting strings as UTF-8
|| join('', unpack('C*', $result)) eq join('', unpack('C*', $utf8)) # should work where it doesn't
);
}
{
my $on_fault_was_called = 0;
print STDERR "Die in server method test(s)...\n";
my $s = SOAP::Lite
-> uri('http://my.own.site.com/My/Parameters')
-> proxy($proxy)
lib/SOAP/Transport/HTTP.pm view on Meta::CPAN
$self->setDebugLogger(\&SOAP::Trace::debug);
return $self;
}
sub send_receive {
my ( $self, %parameters ) = @_;
my ( $context, $envelope, $endpoint, $action, $encoding, $parts ) =
@parameters{qw(context envelope endpoint action encoding parts)};
$encoding ||= 'UTF-8';
$endpoint ||= $self->endpoint;
my $method = 'POST';
$COMPRESS = 'gzip';
$self->options->{is_compress} ||=
exists $self->options->{compress_threshold}
&& eval { require Compress::Zlib };
t/01-core.t view on Meta::CPAN
$serialized = SOAP::Serializer->serialize(
SOAP::Data->name(test => \SOAP::Data->value("\0\1\2\3 \4\5\6", "<123>&\015</123>"))
);
ok($serialized =~ m!<c-gensym(\d+) xsi:type="xsd:base64Binary">AAECAyAgIAQFBg==</c-gensym\1><c-gensym(\d+) xsi:type="xsd:string"><123>&amp;
</123></c-gensym\2>!);
$serialized = SOAP::Serializer->namespaces({})->serialize(
SOAP::Data->name(name=>'value')->attr({attr => '<123>"&"</123>'})
);
ok($serialized =~ m!^<\?xml version="1.0" encoding="UTF-8"\?><name(?: xsi:type="xsd:string"| attr="<123>"&amp"</123>"){2}>value</name>$!);
}
{ # check objects and SOAP::Data
print "Blessed references and SOAP::Data encoding test(s)...\n";
$serialized = SOAP::Serializer->serialize(SOAP::Data->uri('some_urn' => bless {a => 1} => 'ObjectType'));
ok($serialized =~ m!<namesp(\d+):c-gensym(\d+)(:? xsi:type="namesp\d+:ObjectType"| xmlns:namesp\d+="http://namespaces.soaplite.com/perl"| xmlns:namesp\1="some_urn"| xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"| xmlns:xsi="http://www.w3...
}
t/013-array-deserialization.t view on Meta::CPAN
my $som = SOAP::Deserializer->new->deserialize($xml);
my $result = $som->result();
ok (@$result == 2);
ok $result->[0]->isa('outer');
ok $result->[1]->isa('outer');
ok $result->[1]->{ kids }->[0]->isa('inner');
ok $result->[1]->{ kids }->[1]->isa('inner');
__DATA__
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:my="urn:MyNamespace"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Body>
<my:response>
<my:return href="#id0"/>
t/02-payload.t view on Meta::CPAN
$serialized = SOAP::Serializer->method( # same as ->envelope(method =>
SOAP::Data->name('mymethod')->attr({something => 'value'}), 1, 2, 3,
);
ok($serialized =~ /<mymethod something="value">/);
$serialized = SOAP::Serializer
-> envprefix('')
-> method('mymethod');
ok($serialized =~ m!<Envelope(?: xmlns:namesp\d+="http://schemas.xmlsoap.org/soap/envelope/"| namesp\d+:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"| xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"| xmlns:xsi="http://www.w3.o...
$deserialized = SOAP::Deserializer->deserialize('<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3....
ok(! defined $deserialized->namespaceuriof('//getStateName'));
$deserialized = SOAP::Deserializer->deserialize('<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns="a" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http...
ok($deserialized->namespaceuriof('//getStateName') eq 'a');
}
{ # Map type serialization/deserialization
print "Map type serialization/deserialization test(s)...\n";
my $key = "\0\1";
$serialized = SOAP::Serializer->method(aa => SOAP::Data->type(map => {a => 123, $key => 456})->name('maaap'));
{ local $^W; # disable warning on implicit map encoding
t/02-payload.t view on Meta::CPAN
ok(ref $a && $a->{$key} == 456);
}
{ # Stringified type serialization
print "Stringified type serialization test(s)...\n";
$serialized = SOAP::Serializer->serialize(bless { a => 1, _current => [] } => 'SOAP::SOM');
my $test = $serialized;
ok $test =~s{
<\?xml \s version="1.0" \s encoding="UTF-8"\?>
<SOAP__SOM
(?:
\sxsi:type="namesp(\d+):SOAP__SOM"
| \sxmlns:namesp\d+="http://namespaces.soaplite.com/perl"
| \sxmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
| \sxmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
| \sxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| \sxmlns:xsd="http://www.w3.org/2001/XMLSchema"){6}>
}{}xms;
t/02-payload.t view on Meta::CPAN
ok(defined $uri ? defined $data->uri && $data->uri eq $uri
: !defined $data->uri);
}
}
{
print "Deserialization for different SOAP versions test(s)...\n";
my $version = SOAP::Lite->soapversion;
$a = q!<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soapenc="http://www.w3.org/2003/05/soap-encoding"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding"
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<namesp9:echoIntegerArray xmlns:namesp9="http://soapinterop.org/">
<inputIntegerArray soapenc:arrayType="xsd:int[3]" xsi:type="soapenc:Array">
<item xsi:type="xsd:int">1</item>
t/02-payload.t view on Meta::CPAN
SOAP::Lite->soapversion(1.2);
$deserialized = SOAP::Deserializer->deserialize($a);
ok(ref $deserialized->result eq 'ARRAY');
SOAP::Lite->soapversion($version);
}
{
print "Deserialization of multidimensional array of array test(s)...\n";
$a = q!<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope S:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:E='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:a='http://foo.bar.org/'
xmlns:b='http://www.w3.org/2001/XMLSchema'
xmlns:c='http://www.w3.org/2001/XMLSchema-instance'>
<S:Body><a:SomeMethod>
<nums E:arrayType='b:anyType[2,2]'>
<i E:arrayType='b:anyType[3]'>
<i c:type='b:short'>1</i><i c:type='b:short'>2</i><i c:type='b:short'>3</i>
t/03-server.t view on Meta::CPAN
use Test;
BEGIN { plan tests => 32 }
use SOAP::Lite;
my($a, $s, $r, $serialized, $deserialized);
my %tests = (
'XML only' => <<'EOM',
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<soap:Body>
<namesp1:add xmlns:namesp1="http://www.soaplite.com/Calculator">
<c-gensym5 xsi:type="xsd:int">2</c-gensym5>
<c-gensym7 xsi:type="xsd:int">5</c-gensym7>
</namesp1:add>
</soap:Body>
</soap:Envelope>
EOM
'message with headers' => <<'EOM',
Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<soap:Body>
<namesp1:add xmlns:namesp1="http://www.soaplite.com/Calculator">
<c-gensym5 xsi:type="xsd:int">2</c-gensym5>
<c-gensym7 xsi:type="xsd:int">5</c-gensym7>
</namesp1:add>
</soap:Body>
</soap:Envelope>
EOM
'singlepart MIME' => <<'EOM',
Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<calc061400a.xml@soaplite.com>"
--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <calc061400a.xml@soaplite.com>
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<soap:Body>
<namesp1:add xmlns:namesp1="http://www.soaplite.com/Calculator">
<c-gensym5 xsi:type="xsd:int">2</c-gensym5>
<c-gensym7 xsi:type="xsd:int">5</c-gensym7>
</namesp1:add>
</soap:Body>
</soap:Envelope>
--MIME_boundary--
EOM
'multipart MIME' => <<'EOM',
Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<calc061400a.xml@soaplite.com>"
--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <calc061400a.xml@soaplite.com>
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<soap:Body>
<namesp1:add xmlns:namesp1="http://www.soaplite.com/Calculator">
<c-gensym5 xsi:type="xsd:int">2</c-gensym5>
<c-gensym7 xsi:type="xsd:int">5</c-gensym7>
</namesp1:add>
t/03-server.t view on Meta::CPAN
Content-ID: <calc061400a.b@soaplite.com>
5
--MIME_boundary--
EOM
'multipart MIME w/multiref' => <<'EOM',
Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<calc061400a.xml@soaplite.com>"
--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <calc061400a.xml@soaplite.com>
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<soap:Body>
<namesp1:add xmlns:namesp1="http://www.soaplite.com/Calculator">
<c-gensym5 href="cid:calc061400a.a@soaplite.com"/>
<c-gensym7 href="cid:calc061400a.b@soaplite.com"/>
</namesp1:add>
t/04-attach-cid-encoded.t view on Meta::CPAN
$soap->init_context();
##############################################################################
print "Attachment deserialization (Content-ID) test(s)...\n";
$a = $soap->deserializer->deserialize(<<'EOX');
Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<claim061400a.xml@claiming-it.com>"
SOAPAction: http://schemas.risky-stuff.com/Auto-Claim
Content-Description: This is the optional message description.
--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <claim061400a.xml@claiming-it.com>
<?xml version='1.0' ?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<claim:insurance_claim_auto
id="insurance_claim_document_id"
xmlns:claim="http://schemas.risky-stuff.com/Auto-Claim">
t/04-attach-cid-encoded.t view on Meta::CPAN
ok(ref $a && $a->valueof('//realxml')->{b} eq 'c');
##############################################################################
print "Attachment deserialization (Content-ID and Content-Location) test(s)...\n";
$a = $soap->deserializer->deserialize(<<'EOX');
MIME-Version: 1.0
Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<http://claiming-it.com/claim061400a.xml>"
Content-Description: This is the optional message description.
--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <http://claiming-it.com/claim061400a.xml>
Content-Location: http://claiming-it.com/claim061400a.xml
<?xml version='1.0' ?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<claim:insurance_claim_auto
id="insurance_claim_document_id"
t/04-attach-cid-encoded.t view on Meta::CPAN
print "Attachment deserialization (relative Content-Location) test(s)...\n";
# TODO - this unit test breaks - it does not seem to be picking up a base location
# from outer Content-Location
eval { $a = $soap->deserializer->deserialize(<<'EOX'); };
MIME-Version: 1.0
Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<http://claiming-it.com/claim061400a.xml>"
Content-Description: This is the optional message description.
Content-Location: http://claiming-it.com/
--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <http://claiming-it.com/claim061400a.xml>
Content-Location: claim061400a.xml
<?xml version='1.0' ?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<claim:insurance_claim_auto
id="insurance_claim_document_id"
t/04-attach-cid-encoded.t view on Meta::CPAN
ok(ref $a && $a->valueof('//theSignedForm') =~ /binary TIFF image/);
##############################################################################
print "Attachment deserialization (no default Content-Location) test(s)...\n";
$a = $soap->deserializer->deserialize(<<'EOX');
MIME-Version: 1.0
Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<b6f4ccrt@15.4.9.92/s445>"
Content-Description: This is the optional message description.
--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <b6f4ccrt@15.4.9.92/s445>
Content-Location: claim061400a.xml
<?xml version='1.0' ?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<claim:insurance_claim_auto
id="insurance_claim_document_id"
t/04-attach.t view on Meta::CPAN
$soap->init_context();
##############################################################################
print "Attachment deserialization (Content-ID) test(s)...\n";
$a = $soap->deserializer->deserialize(<<'EOX');
Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<claim061400a.xml@claiming-it.com>"
SOAPAction: http://schemas.risky-stuff.com/Auto-Claim
Content-Description: This is the optional message description.
--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <claim061400a.xml@claiming-it.com>
<?xml version='1.0' ?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<claim:insurance_claim_auto
id="insurance_claim_document_id"
xmlns:claim="http://schemas.risky-stuff.com/Auto-Claim">
t/04-attach.t view on Meta::CPAN
##############################################################################
print
"Attachment deserialization (Content-ID and Content-Location) test(s)...\n";
$a = $soap->deserializer->deserialize(<<'EOX');
MIME-Version: 1.0
Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<http://claiming-it.com/claim061400a.xml>"
Content-Description: This is the optional message description.
--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <http://claiming-it.com/claim061400a.xml>
Content-Location: http://claiming-it.com/claim061400a.xml
<?xml version='1.0' ?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<claim:insurance_claim_auto
id="insurance_claim_document_id"
t/04-attach.t view on Meta::CPAN
# TODO - this unit test breaks - it does not seem to be picking up a base location
# from outer Content-Location
eval {
$a = $soap->deserializer->deserialize(<<'EOX'); };
MIME-Version: 1.0
Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<http://claiming-it.com/claim061400a.xml>"
Content-Description: This is the optional message description.
Content-Location: http://claiming-it.com/
--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <http://claiming-it.com/claim061400a.xml>
Content-Location: claim061400a.xml
<?xml version='1.0' ?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<claim:insurance_claim_auto
id="insurance_claim_document_id"
t/04-attach.t view on Meta::CPAN
##############################################################################
print
"Attachment deserialization (no default Content-Location) test(s)...\n";
$a = $soap->deserializer->deserialize(<<'EOX');
MIME-Version: 1.0
Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<b6f4ccrt@15.4.9.92/s445>"
Content-Description: This is the optional message description.
--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <b6f4ccrt@15.4.9.92/s445>
Content-Location: claim061400a.xml
<?xml version='1.0' ?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<claim:insurance_claim_auto
id="insurance_claim_document_id"
t/04-attach.t view on Meta::CPAN
$soap->init_context();
##############################################################################
print "Attachment deserialization (Nested Attachment) test(s)...\n";
$a = $soap->deserializer->deserialize(<<'EOX');
Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<claimstart.xml@claiming-it.com>"
SOAPAction: http://schemas.risky-stuff.com/Auto-Claim
Content-Description: This is the optional message description.
--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <claimstart.xml@claiming-it.com>
<?xml version='1.0' ?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<claim:insurance_claim_auto
id="insurance_claim_document_id"
xmlns:claim="http://schemas.risky-stuff.com/Auto-Claim">
t/05-customxml.t view on Meta::CPAN
print $portfolio->type, " ", $portfolio->date, "\n";
ok($portfolio->type && $portfolio->date);
foreach my $row ($portfolio->Row) {
# test elements
print " ", $row->Element, " ", $row->Value, "\n";
ok($row->Element && $row->Value);
}
}
__DATA__
<?xml version="1.0" encoding="UTF-8"?>
<Envelope version="1.1">
<Header />
<Body>
<Report>
<Header>
<ClientRef />
<FundCusip>61744J366</FundCusip>
<SepAcctDesc />
</Header>
<Request>
t/38-packager.t view on Meta::CPAN
ok(ref $mp);
# check attachment deserialization
print "Attachment deserialization (Content-ID) test(s)...\n";
$env = $mp->unpackage(<<'EOX');
Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"; start="<claim061400a.xml@claiming-it.com>"
SOAPAction: http://schemas.risky-stuff.com/Auto-Claim
Content-Description: This is the optional message description.
--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <claim061400a.xml@claiming-it.com>
<?xml version='1.0' ?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<claim:insurance_claim_auto id="insurance_claim_document_id"
xmlns:claim="http://schemas.risky-stuff.com/Auto-Claim">
<theSignedForm href="cid:claim061400a.tiff@claiming-it.com"/>
t/38-packager.t view on Meta::CPAN
#@part_data = $mp->find_part( id => '<claim061402a.jpeg@claiming-it.com>' );
#ok($part_data[0] eq '...Raw JPEG image..');
#@part_data = $mp->find_part( id => '<claim061403a.somexml@claiming-it.com>' );
#ok($part_data[0] eq '<a><b>c</b></a>');
#@part_data = $mp->find_part( id => '<claim061404a.realxml@claiming-it.com>' );
#ok($part_data[0] eq '<a><b>c</b></a>');
# Test: no start parameter specified
# Content-ID: <claim061400a.xml@claiming-it.com>
# Content-Type: text/xml; charset=UTF-8
$env = $mp->unpackage(<<'EOX');
Content-Type: Multipart/Related; boundary=MIME_boundary; type="text/xml"
SOAPAction: http://schemas.risky-stuff.com/Auto-Claim
Content-Description: This is the optional message description.
--MIME_boundary
Content-Transfer-Encoding: 8bit
<?xml version='1.0' ?>
<SOAP-ENV:Envelope
t/38-packager.t view on Meta::CPAN
SOAPAction: http://schemas.risky-stuff.com/Auto-Claim
Content-Description: This is the optional message description.
--MIME_boundary
Content-Type: text/plain
Content-Transfer-Encoding: binary
Content-ID: <claim061403a.somexml@claiming-it.com>
<a><b>c</b></a>
--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <claim061400a.xml@claiming-it.com>
<?xml version='1.0' ?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<claim:insurance_claim_auto id="insurance_claim_document_id"
xmlns:claim="http://schemas.risky-stuff.com/Auto-Claim">
<theSignedForm href="cid:claim061400a.tiff@claiming-it.com"/>
t/Issues/rt53375.t view on Meta::CPAN
use XML::Parser::Lite;
my $comment = '';
my $parser = new XML::Parser::Lite(
Handlers => {
Comment => sub { $comment .= $_[1]; },
}
);
my $xml = <<'EOT';
<?xml version="1.0" encoding="UTF-8"?>
<!-- seed-viewer -->
<test>
</test>
EOT
eval {
$parser->parse($xml);
};
ok(! $@);
is($comment, ' seed-viewer ');
$comment = '';
$xml = <<'EOT';
<?xml version="1.0" encoding="UTF-8"?>
<!-- seed_viewer -->
<test>
</test>
EOT
eval {
$parser->parse($xml);
};
ok(! $@);
is($comment, ' seed_viewer ');
t/Issues/rt72836.t view on Meta::CPAN
use Test::More;
use SOAP::Lite;
eval { require Test::XML }
or plan skip_all => 'Cannot test without Test::XML';
my $req11 = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Something"><soapenv:Header/><soapenv:Body><urn:do_something><stuff>things</stuff></urn:do_something></soapenv:Body></soapenv:Envelope>';
my $req12 = '<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:Something"><soapenv:Header/><soapenv:Body><urn:do_something><stuff>things</stuff></urn:do_something></soapenv:Body></soapenv:Envelope>';
my $expected_11 = '<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="h...
my $expected_12 = '<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="htt...
my $t = DoThingsWithStuff->new;
my $s = SOAP::Server->new;
$s->dispatch_with({
"urn:Something" => $t
});
my $res_11_1 = $s->handle($req11);
Test::XML::is_xml($res_11_1, $expected_11, "Got correct SOAP 1.1 response");
t/Issues/rt75169.t view on Meta::CPAN
use Test::More;
use SOAP::Lite;
use utf8;
use Encode;
my $data = "ü";
my $soap = SOAP::Serializer->new();
$soap->autotype(0);
my $xml = $soap->envelope( freeform => "$data" );
my ( $cycled ) = values %{ SOAP::Deserializer->deserialize( $xml )->body };
is( length( $data ), length( $cycled ), "UTF-8 string is the same after serializing" );
done_testing;
t/Issues/rt78588.t view on Meta::CPAN
use Test::More;
use SOAP::Lite;
use utf8;
my $data = "mü\x{2013}";
my $serializer = SOAP::Serializer->new();
$serializer->typelookup()->{ base64Binary } = [ 10, sub { 0 }, undef];
my $xml = $serializer->envelope( freeform => $data );
my ( $cycled ) = values %{ SOAP::Deserializer->deserialize( $xml )->body };
is( $data, $cycled, "UTF-8 string is the same after serializing" );
done_testing;