Onvif获取rstp地址GetCapabilities能力时,出现error 4或者52的的解决方法
在获取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;
}
}*/
4.
/*if (soap_flag_Extension && soap->error == SOAP_TAG_MISMATCH)
{ if (soap_in_PointerTott__NetworkInterfaceSetConfigurationExtension2(soap, "tt:Extension", &a->Extension, "tt:NetworkInterfaceSetConfigurationExtension2"))
{ 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;
}
}*/
5.
/*if (soap_flag_Extension && soap->error == SOAP_TAG_MISMATCH)
{ if (soap_in_PointerTott__NetworkInterfaceExtension2(soap, "tt:Extension", &a->Extension, "tt:NetworkInterfaceExtension2"))
{ 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;
}
}*/
6.
/*if (soap_flag_Extension && soap->error == SOAP_TAG_MISMATCH)
{ if (soap_in_PointerTott__NetworkZeroConfigurationExtension(soap, "tt:Extension", &a->Extension, "tt:NetworkZeroConfigurationExtension"))
{ soap_flag_Extension--;
continue;
}
}*/
7.
/*if (soap_flag_Extension && soap->error == SOAP_TAG_MISMATCH)
{ if (soap_in_PointerTott__NetworkProtocolExtension(soap, "tt:Extension", &a->Extension, "tt:NetworkProtocolExtension"))
{ soap_flag_Extension--;
continue;
}
}*/
8.
/*if (soap_flag_Extension && soap->error == SOAP_TAG_MISMATCH)
{ if (soap_in_PointerTott__NetworkInterfaceSetConfigurationExtension(soap, "tt:Extension", &a->Extension, "tt:NetworkInterfaceSetConfigurationExtension"))
{ soap_flag_Extension--;
continue;
}
}*/
9.
/*if (soap_flag_Extension && soap->error == SOAP_TAG_MISMATCH)
{ if (soap_in_PointerTott__NetworkInterfaceExtension(soap, "tt:Extension", &a->Extension, "tt:NetworkInterfaceExtension"))
{ soap_flag_Extension--;
continue;
}
}*/
10.
/* if (soap_flag_Extension && soap->error == SOAP_TAG_MISMATCH)
{ if (soap_in_PointerTott__NetworkHostExtension(soap, "tt:Extension", &a->Extension, "tt:NetworkHostExtension"))
{ soap_flag_Extension--;
continue;
}
}*/
大约有10个左右,不知道还有没有漏网之鱼,所以大家在找的时候可以搜索if (soap_in_PointerTott__Network,把
if (soap_flag_Extension && soap->error == SOAP_TAG_MISMATCH)条件下的都把它注释掉就可以了。