CONTEXT :
I'm making a c# windows form app that communicates to ONVIF cameras using the wsdls given on the onvif site.
https://www.onvif.org/ver10/media/wsdl/media.wsdl
and
https://onvif.org/onvif/ver20/ptz/wsdl/ptz.wsdl
I am able to get profiles on the camera, send PTZ action and more, but when I try to get the status of the ptzClient
I created, I get the error:
Error in deserializing body of reply message for operation 'GetStatus'
I looked in the innerException of this error to find:
The string '1532531507' is not a valid AllXsd value.
Here's how I create my ptzClient:
ServicePointManager.Expect100Continue = false; var commonEncoding = new TextMessageEncodingBindingElement { MessageVersion = MessageVersion.CreateVersion(EnvelopeVersion.Soap12, AddressingVersion.None) }; var commonBinding = new HttpTransportBindingElement { AuthenticationScheme = AuthenticationSchemes.Digest }; var commonCustomBinding = new CustomBinding(commonEncoding, commonBinding); var commonPasswordDigestBehavior = new PasswordDigestBehavior(userName, password); var ptzEndpointAddress = new EndpointAddress($"http://{cameraAddress}/onvif/ptz"); ptzClient = new PTZClient(commonCustomBinding, ptzEndpointAddress); ptzClient.Endpoint.EndpointBehaviors.Add(commonPasswordDigestBehavior);
The error happens when calling this line of code:
var p = ptzClient.GetStatus(profile.token);
When I go see my xml request and its corresponding xml response in wireshark, I see that there is no error :
QUESTION :
How can I manage to make this call without getting these errors?
There isn't much I can change...
It seems that the problem is from the date format, but I don't see a way to change this format.