Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetServiceCapabilities fails in the device-tool-test tests #109

Open
rdx789 opened this issue Jan 19, 2022 · 1 comment
Open

GetServiceCapabilities fails in the device-tool-test tests #109

rdx789 opened this issue Jan 19, 2022 · 1 comment

Comments

@rdx789
Copy link

rdx789 commented Jan 19, 2022

Hello,
I need help with defining the "Capabilities" class so it would pass the Device Tool Test tests.

STEP 5 - Get Media Service capabilities
StepStart: 2022-01-19T07:35:14.1804753Z
Transmit done
Receive done
The element 'Capabilities' in namespace 'http://www.onvif.org/ver10/media/wsdl' has invalid child element 'ProfileCapabilities' in namespace 'http://www.onvif.org/ver10/schema'. List of possible elements expected: 'ProfileCapabilities' in namespace 'http://www.onvif.org/ver10/media/wsdl'.
STEP FAILED

The response:
soap12env:Body
tns:GetServiceCapabilitiesResponse
<tns:Capabilities
SnapshotUri="true"
Rotation="false"
VideoSourceMode="false"
OSD="false">
<s0:ProfileCapabilities
MaximumNumberOfProfiles="10"/>
<s0:StreamingCapabilities
RTPMulticast="false"
RTP_TCP="true"
RTP_RTSP_TCP="true"
NonAggregateControl="false"
NoRTSPStreaming="false"/>
</tns:Capabilities>
</tns:GetServiceCapabilitiesResponse>
</soap12env:Body>

My Code:
Classes:

class ProfileCapabilitiesT(SchemaComplexModel):
type_name = "ProfileCapabilities"
MaximumNumberOfProfiles = XmlAttribute(Int)

class StreamingCapabilitiesT(SchemaComplexModel):
type_name = "StreamingCapabilities"
RTPMulticast = XmlAttribute(Boolean)
RTP_TCP = XmlAttribute(Boolean)
RTP_RTSP_TCP = XmlAttribute(Boolean)
NonAggregateControl = XmlAttribute(Boolean)
NoRTSPStreaming = XmlAttribute(Boolean)

class CapabilitiesT(SchemaComplexModel):
type_name = "Capabilities"
ProfileCapabilities = ProfileCapabilitiesT
StreamingCapabilities = StreamingCapabilitiesT
SnapshotUri = XmlAttribute(Boolean)
Rotation = XmlAttribute(Boolean)
VideoSourceMode = XmlAttribute(Boolean)
OSD = XmlAttribute(Boolean)

class GetServiceCapabilitiesResponseT(MediaComplexModel):
Capabilities = CapabilitiesT

Function:
@rpc(_returns=GetServiceCapabilitiesResponseT, _body_style="out_bare")
def GetServiceCapabilities(ctx):
logging.info("GetServiceCapabilities")

	ret = GetServiceCapabilitiesResponseT()
	caps = CapabilitiesT()
	
	p = ProfileCapabilitiesT()
	n = config.MAX_PROFILES
	p.MaximumNumberOfProfiles = n
	caps.ProfileCapabilities = p

	s = StreamingCapabilitiesT()
	s.RTPMulticast = False
	s.RTP_TCP = True
	s.RTP_RTSP_TCP = True
	s.NonAggregateControl = False
	s.NoRTSPStreaming = False
	caps.StreamingCapabilities = s

	caps.SnapshotUri = True
	caps.Rotation = False
	caps.VideoSourceMode = False
	caps.OSD = False

	ret.Capabilities = caps	
	return ret

I am waiting to understand what is wrong with the definitions,
Thanks in advance

David Ron

@rdx789
Copy link
Author

rdx789 commented Jan 20, 2022

Solved it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant