Subject: | Fault11 serialization issue when passed Element for detail |
Date: | Mon, 2 Mar 2009 09:41:33 -0500 |
To: | <bug-SOAP-WSDL [...] rt.cpan.org> |
From: | "John Green (jjgreen)" <jjgreen [...] cisco.com> |
Distribution: SOAP-WSDL-2.00.09
Perl Version: 5.8.6
Platform: Solaris 8
Issue: SOAP Fault not serializing an element passed as detail correctly
Code sample (run from SOAP-WSDL-2.00.09/example)
#!/usr/bin/perl
use strict;
use warnings;
use lib 'lib', '../lib';
use MyElements::ListPerson;
use SOAP::WSDL::SOAP::Typelib::Fault11;
my $person = MyElements::ListPerson->new(
{ in => {
PersonID => { ID => 1 },
Salutation => 'Mr.',
Name => 'Doe',
GivenName => 'John',
DateOfBirth => '1970/01/01',
}
}
);
print $person->serialize(), "\n";
my $fault = SOAP::WSDL::SOAP::Typelib::Fault11->new(
{ faultcode => 'client',
faultstring => 'Test serialization of fault with details',
faultactor => 'any',
detail => $person
}
);
print $fault->serialize(), "\n"
Got Output
<ListPerson><in><PersonID><ID>1</ID></PersonID><Salutation>Mr.</Salutati
Show quoted text
on><Name>Doe</Name><GivenName>John</GivenName><DateOfBirth>1970/01/01</D
Show quoted textateOfBirth></in></ListPerson>
<Fault><faultcode>client</faultcode><faultstring>Test serialization of
fault with details</faultstring><faultactor>any</faultactor><detail
xmlns="http://www.example.org/benchmark/"><detail><detail><detail><detai
Show quoted textl><detail><detail>1</detail></detail></detail><detail><detail>Mr.</detai
l></detail><detail><detail>Doe</detail></detail><detail><detail>John</de
Show quoted texttail></detail><detail><detail>1970/01/01</detail></detail></detail></Lis
Show quoted texttPerson></Fault>
Expected Output
<ListPerson><in><PersonID><ID>1</ID></PersonID><Salutation>Mr.</Salutati
Show quoted texton><Name>Doe</Name><GivenName>John</GivenName><DateOfBirth>1970/01/01</D
Show quoted textateOfBirth></in></ListPerson>
<Fault><faultcode>client</faultcode><faultstring>Test serialization of
fault with
details</faultstring><faultactor>any</faultactor><detail><ListPerson><in
Show quoted text><PersonID><ID>1</ID></PersonID><Salutation>Mr.</Salutation><Name>Doe</N
Show quoted textame><GivenName>John</GivenName><DateOfBirth>1970/01/01</DateOfBirth></in
Show quoted text></ListPerson></detail></Fault>