Do you think that the above serializer/deserializer is sufficient or any changes need to be made..#Client my $uri = 'Delivery'; my $serializer = DataSerializer->new; print $res->fault ? $res->faultstring. "\n" : $res->result; BEGIN{ package DataSerializer; @DataSerializer::ISA = 'SOAP::Serializer'; sub xmlize { my $self = shift; my($name, $attrs, $values, $id) = @{+shift}; $attrs ||= {}; # keep only namespace attributes for all elements my $a = $attrs->{xmlns} ? {xmlns => $attrs->{xmlns}} : {}; return $self->SUPER::xmlize([$name, $a, $values, $id]); } sub envelope { $_[2] = (UNIVERSAL::isa($_[2] => 'SOAP::Data') ? $_[2] : SOAP::Data->name($_[2])->attr({xmlns => $uri})) if $_[1] =~ /^(?:method|response)$/; shift->SUPER::envelope(@_); } } #End BEGIN block #SERVER SOAP::Transport::HTTP::CGI -> dispatch_to($uri) -> serializer(DataSerializer->new) -> handle; package DataSerializer; @DataSerializer::ISA = 'SOAP::Serializer'; sub xmlize { my $self = shift; my($name, $attrs, $values, $id) = @{+shift}; $attrs ||= {}; # keep only namespace attributes for all elements my $a = $attrs->{xmlns} ? {xmlns => $attrs->{xmlns}} : {}; return $self->SUPER::xmlize([$name, $a, $values, $id]); } sub envelope { $_[2] = (UNIVERSAL::isa($_[2] => 'SOAP::Data') ? $_[2] : SOAP::Data->name($_[2])->attr({xmlns => $uri})) if $_[1] =~ /^(?:method|response)$/; shift->SUPER::envelope(@_); } } #End BEGIN block
In reply to Re^2: SOAP - Returning response from Server to Client request based on the <Action>
by chanakya
in thread SOAP - Returning response from Server to Client request based on the <Action>
by chanakya
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |