在获取Onvi能力soap_call___tds__GetCapabilities的接口中有时候会出现error:4或者52的情况,是因为在soapC.c中用不到extension,所以我们必须得把它注释掉。比如:
if (soap_flag_Extension && soap->error == SOAP_TAG_MISMATCH)
{ if (soap_in_PointerTott__Network*******,
即以soap_flag_Extension && soap->error条件下和 soap_in_PointerTott__Network条件下的都要注释掉。soap_in_PointerTott__Network*******有很多个,以下是我注释的代码:
1、
/*if (soap_flag_Extension && soap->error == SOAP_TAG_MISMATCH)
{ if (soap_in_PointerTott__CapabilitiesExtension(soap, "tt:Extension", &a->Extension, "tt:CapabilitiesExtension"))
{ soap_flag_Extension--;
continue;
}
}*/
2、
/*if (soap_flag_Extension && soap->error == SOAP_TAG_MISMATCH)
{ if (soap_in_PointerTott__NetworkCapabilitiesExtension2(soap, "tt:Extension", &a->Extension, "tt:NetworkCapabilitiesExtension2"))
{ soap_flag_Extension--;
continue;
}
}
if (soap->error == SOAP_TAG_MISMATCH && !soap_peek_element(soap))
{ if (a->__any == NULL)
{ if (soap_blist___any == NULL)
soap_blist___any = soap_alloc_block(soap);
a->__any = (char *)soap_push_block_max(soap, soap_blist___any, sizeof(char));
if (a->__any == NULL)
return NULL;
soap_default_byte(soap, a->__any);
}
if (soap_in_byte(soap, "-any", a->__any, "xsd:byte"))
{ a->__size++;
a->__any = NULL;
continue;
}
}*/
3.
/* if (soap_flag_Extension && soap->error == SOAP_TAG_MISMATCH)
{ if (soap_in_PointerTott__NetworkZeroConfigurationExtension2(soap, "tt:Extension", &a->Extension, "tt:NetworkZeroConfigurationExtension2"))
{ soap_flag_Extension--;
continue;
}
}
if (soap->error == SOAP_TAG_MISMATCH && !soap_peek_element(soap))
{ if (a->__any == NULL)
{ if (soap_blist___any == NULL)
soap_blist___any = soap_alloc_block(soap);
a->__any = (char *)soap_push_block_max(soap, soap_blist___any, sizeof(char));
if (a->__any == NULL)
return NULL;
soap_default_byte(soap, a->__any);
}
if (soap_in_byte(soap, "-any", a->__any, "xsd:byte"))
{ a->__size++;
a->__any = NULL;
continue;
}
}*/
正常注释掉以上接口,GetCapabilities的的错误就能解决掉。
--------------------------------------------------------------------------------------------------------------------------------------------------------
但是有些摄像头的品牌比较少见,依然还会出现:soap error: 52, (null), (null),这时候你要注释以下接口:
1.
/* if (soap_flag_Extension && soap->error == SOAP_TAG_MISMATCH)
{ if (soap_in_PointerTott__RealTimeStreamingCapabilitiesExtension(soap, "tt:Extension", &a->Extension, "tt:RealTimeStreamingCapabilitiesExtension"))
{ soap_flag_Extension--;
continue;
}
}*/
2.
/*if (soap_flag_Extension && soap->error == SOAP_TAG_MISMATCH)
{ if (soap_in_PointerTott__MediaCapabilitiesExtension(soap, "tt:Extension", &a->Extension, "tt:MediaCapabilitiesExtension"))
{ soap_flag_Extension--;
continue;
}
}
if (soap->error == SOAP_TAG_MISMATCH && !soap_peek_element(soap))
{ if (a->__any == NULL)
{ if (soap_blist___any == NULL)
soap_blist___any = soap_alloc_block(soap);
a->__any = (char *)soap_push_block_max(soap, soap_blist___any, sizeof(char));
if (a->__any == NULL)
return NULL;
soap_default_byte(soap, a->__any);
}
if (soap_in_byte(soap, "-any", a->__any, "xsd:byte"))
{ a->__size++;
a->__any = NULL;
continue;
}
}*/
完美解决~
————————————————
版权声明:本文为CSDN博主「Croxd」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_42432281/article/details/85158378