Thread WSDL
(53 answers)
Opened by bianca at 2010-05-22 16:12
ich hab jetzt mal angefangen, mir den SOAP::Lite code anzuschauen.
zeile 3241ff. (sub generate_stub ...) wird eine methode _call erzeugt. und parameter ausgewertet Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 foreach my $param (@_) { if (@templates) { my $template = shift @templates; my ($prefix,$typename) = SOAP::Utils::splitqname($template->type); my $method = 'as_'.$typename; # TODO - if can('as_'.$typename) {...} my $result = $self->serializer->$method($param, $template->name, $template->type, $template->attr); push(@parameters, $template->value($result->[2])); } else { push(@parameters, $param); } } hab ich mal abgeändert in Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 foreach my $param (@_) { if (@templates) { warn "Adding parameter: $param"; my $template = shift @templates; my ($prefix,$typename) = SOAP::Utils::splitqname($template->type); my $method = 'as_'.$typename; # TODO - if can('as_'.$typename) {...} warn "Method name: $method"; my $result = $self->serializer->$method($param, $template->name, $template->type, $template->attr); push(@parameters, my$ v = $template->value($result->[2])); warn "Adding parameter with value: " . Dumper($v); } else { push(@parameters, $param); } } erzeugt dann folgende ausgabe Adding parameter: ARRAY(0x32820bc) at (eval 103) line 92. Method name: as_Map at (eval 103) line 97. Adding parameter with value: $VAR1 = bless( { '_name' => 'params', '_type' => 'tns:Map', '_signature' => [], '_value' => [ undef ], '_attr' => {} }, 'SOAP::Data' ); Adding parameter: foo at (eval 103) line 92. Method name: as_string at (eval 103) line 97. Adding parameter with value: $VAR1 = bless( { '_name' => 'user', '_type' => 'xsd:string', '_signature' => [], '_value' => [ 'foo' ], '_attr' => {} }, 'SOAP::Data' ); Adding parameter: bar at (eval 103) line 92. Method name: as_string at (eval 103) line 97. Adding parameter with value: $VAR1 = bless( { '_name' => 'password', '_type' => 'xsd:string', '_signature' => [], '_value' => [ 'bar' ], '_attr' => {} }, 'SOAP::Data' ); man sieht also, dass er zwar den Map typ erkennt, aber die werte nicht richtig setzt. PS: der aufruf ging über my $rc = $service->get_form([{ key => 'country', value => 'DE' }, { key => 'language', value => 0 }], 'foo', 'bar'); mod-edit pq: teilbaum SOAP::Lite debugging Last edited: 2010-05-22 15:46:53 +0200 (CEST) |