Home > Back-end >  Soap implementations ONVIF protocol PTZControl AbsoluteMove failure
Soap implementations ONVIF protocol PTZControl AbsoluteMove failure

Time:11-03

Consult everybody a great god, and to use gSoap Tool to generate the ONVIF protocol of C code, to achieve the AbsoluteMove of cameras, I use the ONVIF Device Test Tool testing tools, my camera is support AbsoluteMove, but when I call soap_call___tptz__AbsoluteMove method, the return value is always 12, camera also did not move,
Have a great god knows what reason be?
This is my code
 struct _tptz__AbsoluteMove * AbsoluteMove; 
Struct _tptz__AbsoluteMoveResponse * AbsoluteMoveResponse;
AbsoluteMove=(_tptz__AbsoluteMove *) soap_malloc (soap, sizeof (struct _tptz__AbsoluteMove));
AbsoluteMoveResponse=(_tptz__AbsoluteMoveResponse *) soap_malloc (soap, sizeof (struct _tptz__AbsoluteMoveResponse));
Soap_default__tptz__AbsoluteMove (soap, AbsoluteMove);//memory reset
Soap_default__tptz__AbsoluteMoveResponse (soap, AbsoluteMoveResponse);

AbsoluteMove - & gt; ProfileToken=trt__GetProfilesResponse. Profiles - & gt; Token;
AbsoluteMove - & gt; The Position=(tt__PTZVector *) soap_malloc (soap, sizeof (struct tt__PTZVector));
AbsoluteMove - & gt; The Position - & gt; PanTilt=(tt__Vector2D *) soap_malloc (soap, sizeof (struct tt__Vector2D));
AbsoluteMove - & gt; The Position - & gt; PanTilt - & gt; X=0.9798;//P here is literally write several number
AbsoluteMove - & gt; The Position - & gt; PanTilt - & gt; Y=0.6768;//T
AbsoluteMove - & gt; The Position - & gt; PanTilt - & gt; Space=(char *) soap_malloc (soap, 128);
Strcpy (AbsoluteMove - & gt; The Position - & gt; PanTilt - & gt; Space, "http://www.onvif.org/ver10/schema");
AbsoluteMove - & gt; Speed=(tt__PTZSpeed *) soap_malloc (soap, sizeof (struct tt__PTZSpeed));
AbsoluteMove - & gt; Speed - & gt; PanTilt=(tt__Vector2D *) soap_malloc (soap, sizeof (struct tt__Vector2D));.
AbsoluteMove - & gt; Speed - & gt; PanTilt - & gt; X=1.0;//P direction speed
AbsoluteMove - & gt; Speed - & gt; PanTilt - & gt; Y=1.0;//T direction speed
AbsoluteMove - & gt; Speed - & gt; PanTilt - & gt; Space=(char *) soap_malloc (soap, 128);
Strcpy (AbsoluteMove - & gt; Speed - & gt; PanTilt - & gt; Space, "http://www.onvif.org/ver10/schema");

AbsoluteMove - & gt; The Position - & gt; Zoom=(tt__Vector1D *) soap_malloc (soap, sizeof (struct tt__Vector1D));
AbsoluteMove - & gt; The Position - & gt; Zoom - & gt; X=0.7646;//Z
AbsoluteMove - & gt; The Position - & gt; Zoom - & gt; Space=(char *) soap_malloc (soap, 128);
Strcpy (AbsoluteMove - & gt; The Position - & gt; Zoom - & gt; Space, "http://www.onvif.org/ver10/schema");
AbsoluteMove - & gt; Speed - & gt; Zoom=(tt__Vector1D *) soap_malloc (soap, sizeof (struct tt__Vector1D));.
AbsoluteMove - & gt; Speed - & gt; Zoom - & gt; X=1.0;//Z zooming speed
AbsoluteMove - & gt; Speed - & gt; Zoom - & gt; Space=(char *) soap_malloc (soap, 128);
Strcpy (AbsoluteMove - & gt; Speed - & gt; Zoom - & gt; Space, "http://www.onvif.org/ver10/schema");

Soap_wsse_add_UsernameTokenDigest (soap, ", "UserName. C_str (), the PassWord. The c_str ());
Int ret=soap_call___tptz__AbsoluteMove (soap, capa_resp. "Capabilities - & gt; PTZ - & gt; XAddr, NULL, AbsoluteMove AbsoluteMoveResponse);
If (ret==SOAP_OK)
{
Printf (" AbsoluteMove - OK \ n ");
}
  • Related