our
$VERSION
= version->new(
'0.09'
);
has
style
=> (
is
=>
'rw'
,
isa
=>
'Str'
,
builder
=>
'_style'
,
lazy
=> 1,
);
has
action
=> (
is
=>
'rw'
,
isa
=>
'Str'
,
builder
=>
'_action'
,
lazy
=> 1,
);
has
inputs
=> (
is
=>
'rw'
,
isa
=>
'ArrayRef[W3C::SOAP::WSDL::Document::InOutPuts]'
,
builder
=>
'_inputs'
,
lazy
=> 1,
);
has
outputs
=> (
is
=>
'rw'
,
isa
=>
'ArrayRef[W3C::SOAP::WSDL::Document::InOutPuts]'
,
builder
=>
'_outputs'
,
lazy
=> 1,
);
has
faults
=> (
is
=>
'rw'
,
isa
=>
'ArrayRef[W3C::SOAP::WSDL::Document::InOutPuts]'
,
builder
=>
'_faults'
,
lazy
=> 1,
);
has
port_type
=> (
is
=>
'rw'
,
isa
=>
'W3C::SOAP::WSDL::Document::Operation'
,
builder
=>
'_port_type'
,
lazy
=> 1,
);
has
binding_operation
=> (
is
=>
'rw'
,
isa
=>
'Maybe[W3C::SOAP::WSDL::Document::Operation]'
,
predicate
=>
'has_binding_operation'
,
);
sub
_style {
my
(
$self
) =
@_
;
my
$style
=
$self
->node->getAttribute(
'style'
);
if
( !
defined
$style
) {
if
(
my
(
$child
) =
$self
->_soap_binding_node() ) {
$style
=
$child
->getAttribute(
'style'
);
}
else
{
if
(
my
(
$child
) =
$self
->_soap_operation_node() ) {
$style
=
$child
->getAttribute(
'style'
);
}
}
}
return
$style
}
sub
_action {
my
(
$self
) =
@_
;
my
$action
=
$self
->node->getAttribute(
'soapAction'
);
if
( !
defined
$action
) {
if
(
my
(
$child
) =
$self
->_soap_operation_node() ) {
$action
=
$child
->getAttribute(
'soapAction'
);
}
}
return
$action
;
}
sub
_soap_operation_node {
my
(
$self
) =
@_
;
return
$self
->document->xpc->findnodes(
'soap:operation'
,
$self
->node);
}
sub
_soap_binding_node {
my
(
$self
) =
@_
;
return
$self
->document->xpc->findnodes(
'../soap:binding'
,
$self
->node);
}
sub
_inputs {
return
$_
[0]->_in_out_puts(
'input'
); }
sub
_outputs {
return
$_
[0]->_in_out_puts(
'output'
); }
sub
_faults {
return
$_
[0]->_in_out_puts(
'fault'
); }
sub
_in_out_puts {
my
(
$self
,
$dir
) =
@_
;
my
@puts
;
my
@nodes
=
$self
->document->xpc->findnodes(
"wsdl:$dir"
,
$self
->node);
for
my
$node
(
@nodes
) {
push
@puts
, W3C::SOAP::WSDL::Document::InOutPuts->new(
parent_node
=>
$self
,
node
=>
$node
,
dir
=>
$dir
,
);
}
return
\
@puts
;
}
sub
_port_type {
my
(
$self
) =
@_
;
my
$ret
;
PORT_TYPE:
for
my
$port_type
(@{
$self
->document->port_types }) {
for
my
$operation
(@{
$port_type
->operations }) {
if
(
$operation
->name eq
$self
->name ) {
$ret
=
$operation
;
$ret
->binding_operation(
$self
);
}
}
}
return
$ret
;
}
1;