Subject: | wsa:Action |
Both versions of WSA support explicit wsa:Action association using
wsa09:Action (for 0.9) or wsaw:Action (for 1.0) attribute in
input/output elements of operation in wsdl-schema.
For 1.0 it is documented here:
http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/#explicitaction
I wrote some patch to your code. It is rather ugly, you can see it in
attachment. Can you add a logic of it into your module, please?
Subject: | wsa.patch |
--- /home/amashanov/perl5lib/lib/perl5/site_perl/5.8.8/XML/Compile/SOAP/WSA.pm Thu Oct 7 23:41:25 2010
+++ ../../SOAP/WSA.pm Thu Oct 28 23:35:45 2010
@@ -17,6 +17,7 @@
use File::Spec ();
use File::Basename qw/dirname/;
+use List::Util qw/first/;
my @common_hdr_elems = qw/To From Action ReplyTo FaultTo MessageID
RelatesTo RetryAfter/;
@@ -72,6 +73,17 @@
$self->_load_ns($wsdl, $def->{xsd});
$self->_load_ns($wsdl, '20060512-wsaw.xsd');
+ my $wsa_action_ns = $self->version eq '0.9' ? $ns : WSDL11WSAW;
+ $wsdl->addHook(
+ type => '{http://schemas.xmlsoap.org/wsdl/}tParam',
+ after => sub {
+ my( $xml, $data, $path ) = @_;
+ my $wsa_action = $xml->getAttributeNS( $wsa_action_ns, 'Action' );
+ $data->{wsa_action} = $wsa_action if $wsa_action;
+ return $data;
+ },
+ );
+
# For unknown reason, the FaultDetail header is described everywhere,
# except in the schema.
$wsdl->importDefinitions( <<_FAULTDETAIL );
@@ -109,8 +121,10 @@
sub soap11ClientWrapper($$@)
{ my ($self, $op, $call, %args) = @_;
+ my $op_def = first { $_->{name} eq $op->name }
+ @{$op->schemas->findDef(portType => $op->portTypeName)->{wsdl_operation}||[]};
my $to = $args{To} || ($op->endPoints)[0];
- my $action = $args{Action} || $op->soapAction;
+ my $action = $args{Action} || $op_def->{wsdl_input}->{wsa_action} || $op->soapAction;
trace "added wsa in call $to for $action";
sub