WSDiscovery: workaround for SOAP::WSDL QName limitation
This commit is contained in:
parent
8b92151a0c
commit
5d3f5e5a4a
|
@ -7,8 +7,10 @@ __PACKAGE__->_set_element_form_qualified(0);
|
|||
|
||||
sub get_xmlns { 'http://schemas.xmlsoap.org/ws/2005/04/discovery' };
|
||||
|
||||
our $XML_ATTRIBUTE_CLASS;
|
||||
undef $XML_ATTRIBUTE_CLASS;
|
||||
our $XML_ATTRIBUTE_CLASS = 'WSDiscovery10::Types::ProbeType::_ProbeType::XmlAttr';
|
||||
|
||||
#our $XML_ATTRIBUTE_CLASS;
|
||||
#undef $XML_ATTRIBUTE_CLASS;
|
||||
|
||||
sub __get_attr_class {
|
||||
return $XML_ATTRIBUTE_CLASS;
|
||||
|
@ -49,11 +51,55 @@ __PACKAGE__->_factory(
|
|||
} # end BLOCK
|
||||
|
||||
|
||||
package WSDiscovery10::Types::ProbeType::_ProbeType::XmlAttr;
|
||||
#use base qw(SOAP::WSDL::XSD::Typelib::ComplexType);
|
||||
use Class::Std::Fast::Storable constructor => 'none', cache => 1;
|
||||
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType);
|
||||
|
||||
|
||||
{ # BLOCK to scope variables
|
||||
|
||||
my %Attribs_of :ATTR(:get<Attribs>);
|
||||
|
||||
sub new
|
||||
{
|
||||
my $self = pop @{ Class::Std::Fast::OBJECT_CACHE_REF()->{ $_[0] } };
|
||||
$self = bless \(my $o = Class::Std::Fast::ID()), $_[0]
|
||||
if not defined $self;
|
||||
|
||||
$self->BUILD(${$self}, $_[1]);
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub BUILD
|
||||
{
|
||||
my ($self, $ident, $arg_ref) = @_;
|
||||
|
||||
$Attribs_of{$ident} = $arg_ref;
|
||||
}
|
||||
|
||||
# without this no attributes are serialized
|
||||
# SOAP::WSDL::XSD::Typelib::CompexType sub serialize_attr()
|
||||
|
||||
sub as_bool :BOOLIFY { 1 }
|
||||
|
||||
sub serialize()
|
||||
{
|
||||
my $ident = ${ $_[0] };
|
||||
my $option_ref = $_[1];
|
||||
my $attr_str = "";
|
||||
|
||||
foreach my $attr (keys %{$Attribs_of{$ident}})
|
||||
{
|
||||
my $value = %{$Attribs_of{$ident}}{$attr};
|
||||
$attr_str .= " $attr=\"$value\"";
|
||||
}
|
||||
|
||||
return $attr_str;
|
||||
}
|
||||
|
||||
} # end BLOCK
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
@ -212,7 +212,9 @@ sub discover
|
|||
|
||||
$result = $svc_discover->ProbeOp(
|
||||
{ # WSDiscovery::Types::ProbeType
|
||||
Types => 'http://www.onvif.org/ver10/network/wsdl:NetworkVideoTransmitter http://www.onvif.org/ver10/device/wsdl:Device', # QNameListType
|
||||
xmlattr => { 'xmlns:dn' => 'http://www.onvif.org/ver10/network/wsdl',
|
||||
'xmlns:tds' => 'http://www.onvif.org/ver10/device/wsdl', },
|
||||
Types => 'dn:NetworkVideoTransmitter tds:Device', # QNameListType
|
||||
Scopes => { value => '' },
|
||||
},
|
||||
WSDiscovery10::Elements::Header->new({
|
||||
|
|
Loading…
Reference in New Issue