ControlPoint: Namespace konfigurierbar gemacht

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@18187 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Reinerlein 2019-01-08 22:01:47 +00:00
parent 5f47a9b89d
commit ee0054c463

View File

@ -52,6 +52,7 @@ our @IGNOREIP;
our @USEDONLYIP; our @USEDONLYIP;
our $LogLevel; our $LogLevel;
our $EnvPrefix; our $EnvPrefix;
our $EnvNamespace;
sub isIgnoreIP($) { sub isIgnoreIP($) {
my($ip) = @_; my($ip) = @_;
@ -104,6 +105,7 @@ sub new {
@USEDONLYIP = @{$args{UsedOnlyIP}}; @USEDONLYIP = @{$args{UsedOnlyIP}};
$LogLevel = $args{LogLevel} || 0; $LogLevel = $args{LogLevel} || 0;
$EnvPrefix = $args{EnvPrefix} || $SOAP::Constants::PREFIX_ENV; $EnvPrefix = $args{EnvPrefix} || $SOAP::Constants::PREFIX_ENV;
$EnvNamespace = $args{EnvNamespace} || 'u';
my $reuseport = $args{ReusePort}; my $reuseport = $args{ReusePort};
$reuseport = 0 if (!defined($reuseport)); $reuseport = 0 if (!defined($reuseport));
@ -710,15 +712,26 @@ sub queryStateVariable {
my $result; my $result;
if ($SOAP::Lite::VERSION >= 0.67) { if ($SOAP::Lite::VERSION >= 0.67) {
$result = SOAP::Lite if ($EnvNamespace eq '<undef>') {
->envprefix($EnvPrefix) $result = SOAP::Lite
->ns("u") ->envprefix($EnvPrefix)
->uri('urn:schemas-upnp-org:control-1-0') ->uri('urn:schemas-upnp-org:control-1-0')
->proxy($self->controlURL) ->proxy($self->controlURL)
->call('QueryStateVariable' => ->call('QueryStateVariable' =>
SOAP::Data->name('varName') SOAP::Data->name('varName')
->uri('urn:schemas-upnp-org:control-1-0') ->uri('urn:schemas-upnp-org:control-1-0')
->value($name)); ->value($name));
} else {
$result = SOAP::Lite
->envprefix($EnvPrefix)
->ns($EnvNamespace)
->uri('urn:schemas-upnp-org:control-1-0')
->proxy($self->controlURL)
->call('QueryStateVariable' =>
SOAP::Data->name('varName')
->uri('urn:schemas-upnp-org:control-1-0')
->value($name));
}
} else { } else {
$result = SOAP::Lite $result = SOAP::Lite
->envprefix($EnvPrefix) ->envprefix($EnvPrefix)
@ -882,10 +895,20 @@ sub new {
my($class, $service) = @_; my($class, $service) = @_;
if ($SOAP::Lite::VERSION >= 0.67) { if ($SOAP::Lite::VERSION >= 0.67) {
return bless { if ($EnvNamespace eq '<undef>') {
_service => $service, return bless {
_proxy => SOAP::Lite->envprefix($EnvPrefix)->ns("u")->uri($service->serviceType)->proxy($service->controlURL), _service => $service,
}, $class; _proxy => SOAP::Lite->envprefix($EnvPrefix)
->uri($service->serviceType)->proxy($service->controlURL),
}, $class;
} else {
return bless {
_service => $service,
_proxy => SOAP::Lite->envprefix($EnvPrefix)
->ns($EnvNamespace)
->uri($service->serviceType)->proxy($service->controlURL),
}, $class;
}
} else { } else {
return bless { return bless {
_service => $service, _service => $service,