in reply to Re: SOAP - Returning response from Server to Client request based on the <Action>
in thread SOAP - Returning response from Server to Client request based on the <Action>
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: SOAP - Returning response from Server to Client request based on the <Action>
by jhourcle (Prior) on Apr 06, 2005 at 11:23 UTC | |
Re^3: SOAP - Returning response from Server to Client request based on the <Action>
by gellyfish (Monsignor) on Apr 06, 2005 at 11:37 UTC |