import SOAP-WSDL 2.00_13 from CPAN
git-cpan-module: SOAP-WSDL git-cpan-version: 2.00_13 git-cpan-authorid: MKUTTER git-cpan-file: authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_13.tar.gz
This commit is contained in:
1 parent
fd0854e34a
commit
f63138fc87
181 files changed
+8714
-8161
No files matched your search
+6
-6
@@ -9,8 +9,8 @@ use base (
|
||||
);
|
||||
|
||||
__PACKAGE__->__set_name('MyElementName');
|
||||
sub get_xmlns { 'urn:Test' };
|
||||
|
||||
sub get_xmlns { 'urn:Test' };
|
||||
|
||||
package MyComplexTypeElement;
|
||||
use strict;
|
||||
use SOAP::WSDL::XSD::Typelib::Element;
|
||||
@@ -32,8 +32,8 @@ use base (
|
||||
'SOAP::WSDL::XSD::Typelib::Builtin::string',
|
||||
);
|
||||
|
||||
__PACKAGE__->__set_name('MyTestElement');
|
||||
|
||||
__PACKAGE__->__set_name('MyTestElement');
|
||||
|
||||
sub get_xmlns { 'urn:Test' };
|
||||
|
||||
package MyTestElement2;
|
||||
@@ -60,7 +60,7 @@ use base (
|
||||
'SOAP::WSDL::XSD::Typelib::Element',
|
||||
'SOAP::WSDL::XSD::Typelib::ComplexType',
|
||||
);
|
||||
|
||||
|
||||
my %test_of :ATTR(:get<test>);
|
||||
my %test2_of :ATTR(:get<test2>);
|
||||
|
||||
@@ -80,5 +80,5 @@ __PACKAGE__->_factory(
|
||||
);
|
||||
|
||||
__PACKAGE__->__set_name('MyAtomicComplexTypeElement');
|
||||
|
||||
|
||||
1;
|
||||
+63
-63
@@ -1,64 +1,64 @@
|
||||
package Test::SOAPMessage;
|
||||
|
||||
use strict;
|
||||
|
||||
use SOAP::Lite;
|
||||
use Test::Differences;
|
||||
use Tie::IxHash;
|
||||
|
||||
use base qw/Exporter/;
|
||||
|
||||
our @EXPORT = qw/soap_eq_or_diff/;
|
||||
|
||||
sub soap_eq_or_diff
|
||||
{
|
||||
my $got = shift;
|
||||
my $expected = shift;
|
||||
my $message = shift;
|
||||
my $soapGot = SOAP::Deserializer->deserialize( $got );
|
||||
my $soapExpected = SOAP::Deserializer->deserialize( $expected );
|
||||
|
||||
return eq_or_diff(
|
||||
unlather( $soapGot ),
|
||||
unlather( $soapExpected ),
|
||||
$message
|
||||
);
|
||||
}
|
||||
|
||||
sub unlather
|
||||
{
|
||||
my $som = shift;
|
||||
my $path = shift || '/Envelope/Body/[1]';
|
||||
my $data = shift;
|
||||
|
||||
unless ( $data )
|
||||
{
|
||||
my %hashData = ();
|
||||
tie (%hashData, q/Tie::IxHash/);
|
||||
$data = \%hashData;
|
||||
}
|
||||
|
||||
my $value;
|
||||
my $tag;
|
||||
my $i = 1;
|
||||
while( $som->match("$path/[$i]") )
|
||||
{
|
||||
$tag = $som->dataof->name();
|
||||
$data ||= {};
|
||||
$value = unlather($som,$path.'/'. '[' . $i . ']' ) || $som->valueof("$path/[$i]");
|
||||
if ($data->{ $tag })
|
||||
{
|
||||
$data->{ $tag } = [ $data->{ $tag } ] unless ( ref ( $data->{ $tag } ) eq 'ARRAY' );
|
||||
push @{ $data->{ $tag } }, $value;
|
||||
}
|
||||
else
|
||||
{
|
||||
$data->{ $tag } = $value;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$data ||= $som->valueof($path);
|
||||
return $data;
|
||||
}
|
||||
|
||||
package Test::SOAPMessage;
|
||||
|
||||
use strict;
|
||||
|
||||
use SOAP::Lite;
|
||||
use Test::Differences;
|
||||
use Tie::IxHash;
|
||||
|
||||
use base qw/Exporter/;
|
||||
|
||||
our @EXPORT = qw/soap_eq_or_diff/;
|
||||
|
||||
sub soap_eq_or_diff
|
||||
{
|
||||
my $got = shift;
|
||||
my $expected = shift;
|
||||
my $message = shift;
|
||||
my $soapGot = SOAP::Deserializer->deserialize( $got );
|
||||
my $soapExpected = SOAP::Deserializer->deserialize( $expected );
|
||||
|
||||
return eq_or_diff(
|
||||
unlather( $soapGot ),
|
||||
unlather( $soapExpected ),
|
||||
$message
|
||||
);
|
||||
}
|
||||
|
||||
sub unlather
|
||||
{
|
||||
my $som = shift;
|
||||
my $path = shift || '/Envelope/Body/[1]';
|
||||
my $data = shift;
|
||||
|
||||
unless ( $data )
|
||||
{
|
||||
my %hashData = ();
|
||||
tie (%hashData, q/Tie::IxHash/);
|
||||
$data = \%hashData;
|
||||
}
|
||||
|
||||
my $value;
|
||||
my $tag;
|
||||
my $i = 1;
|
||||
while( $som->match("$path/[$i]") )
|
||||
{
|
||||
$tag = $som->dataof->name();
|
||||
$data ||= {};
|
||||
$value = unlather($som,$path.'/'. '[' . $i . ']' ) || $som->valueof("$path/[$i]");
|
||||
if ($data->{ $tag })
|
||||
{
|
||||
$data->{ $tag } = [ $data->{ $tag } ] unless ( ref ( $data->{ $tag } ) eq 'ARRAY' );
|
||||
push @{ $data->{ $tag } }, $value;
|
||||
}
|
||||
else
|
||||
{
|
||||
$data->{ $tag } = $value;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$data ||= $som->valueof($path);
|
||||
return $data;
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,5 +1,5 @@
|
||||
package Typelib::Base;
|
||||
use Class::Std::Storable;
|
||||
use Class::Std::Storable;
|
||||
|
||||
sub mk_add_mutators {
|
||||
my $class = shift;
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package Typelib::TEnqueueMessage;
|
||||
use strict;
|
||||
use base qw(Typelib::Base);
|
||||
|
||||
my %MMessage_of :ATTR(:name<MMessage> :default<()>);
|
||||
|
||||
my %attributes_of :ATTR();
|
||||
|
||||
%attributes_of = (
|
||||
MMessage => \%MMessage_of,
|
||||
);
|
||||
|
||||
# make a add_BLA method for every attribute
|
||||
__PACKAGE__->mk_add_mutators( \%attributes_of );
|
||||
|
||||
|
||||
1;
|
||||
package Typelib::TEnqueueMessage;
|
||||
use strict;
|
||||
use base qw(Typelib::Base);
|
||||
|
||||
my %MMessage_of :ATTR(:name<MMessage> :default<()>);
|
||||
|
||||
my %attributes_of :ATTR();
|
||||
|
||||
%attributes_of = (
|
||||
MMessage => \%MMessage_of,
|
||||
);
|
||||
|
||||
# make a add_BLA method for every attribute
|
||||
__PACKAGE__->mk_add_mutators( \%attributes_of );
|
||||
|
||||
|
||||
1;
|
||||
+25
-25
@@ -1,26 +1,26 @@
|
||||
package Typelib::TMessage;
|
||||
use strict;
|
||||
use base qw(Typelib::Base);
|
||||
|
||||
my %MRecipientURI_of :ATTR(:name<MRecipientURI> :default<()>);
|
||||
my %MMessageContent_of :ATTR(:name<MMessageContent> :default<()>);
|
||||
my %MSenderAddress_of :ATTR(:name<MSenderAddress> :default<()>);
|
||||
my %MSubject_of :ATTR(:name<MSubject> :default<()>);
|
||||
my %MDeliveryReportRecipientURI_of :ATTR(:name<MDeliveryReportRecipientURI> :default<()>);
|
||||
my %MKeepalive_of :ATTR(:name<MKeepalive> :default<()>);
|
||||
|
||||
my %attributes_of :ATTR();
|
||||
|
||||
%attributes_of = (
|
||||
MRecipientURI => \%MRecipientURI_of,
|
||||
MMessageContent => \%MMessageContent_of,
|
||||
MSenderAddress => \%MSenderAddress_of,
|
||||
MSubject => \%MSubject_of,
|
||||
MDeliveryReportRecipientURI => \%MDeliveryReportRecipientURI_of,
|
||||
MKeepalive => \%MKeepalive_of,
|
||||
);
|
||||
|
||||
# make a add_BLA method for every attribute
|
||||
__PACKAGE__->mk_add_mutators( \%attributes_of );
|
||||
|
||||
package Typelib::TMessage;
|
||||
use strict;
|
||||
use base qw(Typelib::Base);
|
||||
|
||||
my %MRecipientURI_of :ATTR(:name<MRecipientURI> :default<()>);
|
||||
my %MMessageContent_of :ATTR(:name<MMessageContent> :default<()>);
|
||||
my %MSenderAddress_of :ATTR(:name<MSenderAddress> :default<()>);
|
||||
my %MSubject_of :ATTR(:name<MSubject> :default<()>);
|
||||
my %MDeliveryReportRecipientURI_of :ATTR(:name<MDeliveryReportRecipientURI> :default<()>);
|
||||
my %MKeepalive_of :ATTR(:name<MKeepalive> :default<()>);
|
||||
|
||||
my %attributes_of :ATTR();
|
||||
|
||||
%attributes_of = (
|
||||
MRecipientURI => \%MRecipientURI_of,
|
||||
MMessageContent => \%MMessageContent_of,
|
||||
MSenderAddress => \%MSenderAddress_of,
|
||||
MSubject => \%MSubject_of,
|
||||
MDeliveryReportRecipientURI => \%MDeliveryReportRecipientURI_of,
|
||||
MKeepalive => \%MKeepalive_of,
|
||||
);
|
||||
|
||||
# make a add_BLA method for every attribute
|
||||
__PACKAGE__->mk_add_mutators( \%attributes_of );
|
||||
|
||||
1;
|
||||
Reference in new issue
Block a user