Sorry, I do not know if my question can be answer in this group, but I’m a newby in ws_discovery and in gsoap and I’m developing a tool to discover onvif ipcameras.
I have a IpfFastDomo onvif-compliant and when the camera sends a hello my application reaches a soap_fault in <d:Types> element:
My example code is very simple:
soap_init (&discovery);
soap_set_namespaces (&discovery, dpws_namespaces);
#ifdef DEBUG
soap_set_omode (&discovery, SOAP_C_UTFSTRING | SOAP_XML_INDENT);
#endif
/* initialize stack */
target_cache = dpws_create_tc (NULL);
if (dpws_init2 (&discovery_dpws, "0.0.0.0", target_cache) != SOAP_OK)
{
dpws_done (&discovery_dpws);
exit (0);
}
if (dpws_init_implicit_discovery2(&discovery_dpws, target_cache, &discovery, &discovery_hooks) != SOAP_OK)
{
dpws_done (&discovery_dpws);
exit (0);
}
//ponemos a leer
while (1)
{
err = dpws_discovery_process (&discovery, 1000);
if ((err != SOAP_EOF) && (err != SOAP_OK) && (err != SOAP_STOP))
{
soap_print_fault (&discovery, stderr);
}
}
The message from the IP camera is:
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope
xmlns:a=http://schemas.xmlsoap.org/ws/2004/08/addressing xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery"
xmlns:s="http://www.w3.org/2003/05/soap-envelope" >
<s:Header>
<a:Action>http://schemas.xmlsoap.org/ws/2005/04/discovery/Hello</a:Action>
<a:MessageID>uuid:00000000-0000-0000-0000-000ffc23018c</a:MessageID>
<a:To>urn:schemas-xmlsoap-org:ws:2005:04:discovery</a:To>
<d:AppSequence InstanceId="1" MessageNumber="1" />
</s:Header>
<s:Body>
<d:Hello>
<a:EndpointReference>
<a:Address>uuid:00000000-0000-0000-0000-000ffc23018c</a:Address>
</a:EndpointReference>
<d:Types>dn:NetworkVideoTransmitter</wsd:Types>
<d:Scopes>
onvif://www.onvif.org/hardware/IPFastDome
onvif://www.onvif.org/name/IPFastDome
onvif://www.onvif.org/type/video_encoder
onvif://www.onvif.org/type/ptz
onvif://www.onvif.org/location/country/taiwan
</wsd:Scopes>
<wsd:XAddrs>http://172.16.23.166/onvif/device_service</wsd:XAddrs>
<d:MetadataVersion>1</d:MetadataVersion>
</d:Hello>
</s:Body>
</s:Envelope>
I do not know if the problem is that the <d:Types> is closed by a </wsd:Types>. I’m a bit confused with the namespaces. Maybe I must initialize some things in the soap struct?
Please, somebody can help me.
Conchi Felipe
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgación, copia o distribución a terceros sin la previa autorización escrita de LANACCESS TELECOM SA. En caso de no ser usted la persona a la que fuera dirigido este mensaje y a pesar de ello continúa leyéndolo, ponemos en su conocimiento que está cometiendo un acto ilícito en virtud de la legislación vigente en la actualidad, por lo que deberá dejarlo de leer automáticamente. LANACCESS TELECOM SA no es responsable de su integridad, exactitud, o de lo que acontezca cuando el correo electrónico circula por las infraestructuras de comunicaciones electrónicas públicas. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente. El correo electrónico vía Internet no permite asegurar la confidencialidad de los mensajes que se transmiten ni su integridad o correcta recepción, por lo que LANACCESS TELECOM SA no asume ninguna responsabilidad que pueda derivarse de este hecho.
No imprima este correo si no es necesario. Ahorrar papel protege el medio ambiente.
Sorry for my late response!
Am 26.05.2011 17:07, schrieb conchi:
> Sorry, I do not know if my question can be answer in this group, but I�m
> a newby in ws_discovery and in gsoap and I�m developing a tool to
> discover onvif ipcameras.
>
> I have a IpfFastDomo onvif-compliant and when the camera sends a hello
> my application reaches a soap_fault in <d:Types> element:
>
> *My example code is very simple:*
>
> /soap_init (&discovery);/
>
> /soap_set_namespaces (&discovery, dpws_namespaces); /
>
> /#ifdef//DEBUG/
>
> /soap_set_omode (&discovery, SOAP_C_UTFSTRING | SOAP_XML_INDENT);/
>
> /#endif/
>
> //
>
> //* initialize stack *//
>
> /target_cache = dpws_create_tc (NULL);/
>
> /if (dpws_init2 (&discovery_dpws, "0.0.0.0", target_cache) != //SOAP_OK) /
>
> ///{/
>
> /dpws_done (&discovery_dpws);/
>
> /exit (0);/
>
> /}/
>
> //
>
> /if (dpws_init_implicit_discovery2(&discovery_dpws, target_cache,
> &discovery, &discovery_hooks) != SOAP_OK)/
>
> /{/
>
> /dpws_done (&discovery_dpws);/
>
> /exit (0);/
>
> /}/
>
> //
>
> ///ponemos a leer/
>
> /while (1)/
>
> /{/
>
> /err = dpws_discovery_process (&discovery, 1000);/
>
> /if ((err != SOAP_EOF) && (err != SOAP_OK) && (err != SOAP_STOP))/
>
> /{/
>
> /soap_print_fault (&discovery, stderr);/
>
> /}/
>
> /}/
>
> *The message from the IP camera is:*
>
> /<?xml version="1.0" encoding="UTF-8"?>/
>
> /<s:Envelope /
>
> /xmlns:a=http://schemas.xmlsoap.org/ws/2004/08/addressing
> xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery" /
>
> /xmlns:s="http://www.w3.org/2003/05/soap-envelope" >/
>
> //
>
> /<s:Header>/
>
> /<a:Action>http://schemas.xmlsoap.org/ws/2005/04/discovery/Hello</a:Action>/
>
> /<a:MessageID>uuid:00000000-0000-0000-0000-000ffc23018c</a:MessageID>/
>
> /<a:To>urn:schemas-xmlsoap-org:ws:2005:04:discovery</a:To>/
>
> /<d:AppSequence InstanceId="1" MessageNumber="1" />/
>
> /</s:Header>/
>
> //
>
> /<s:Body>/
>
> /<d:Hello>/
>
> /<a:EndpointReference>/
>
> /<a:Address>uuid:00000000-0000-0000-0000-000ffc23018c</a:Address>/
>
> /</a:EndpointReference>/
>
> /<d:Types>dn:NetworkVideoTransmitter</wsd:Types>/
>
> /<d:Scopes>/
>
> /onvif://www.onvif.org/hardware/IPFastDome /
>
> /onvif://www.onvif.org/name/IPFastDome /
>
> /onvif://www.onvif.org/type/video_encoder/
>
> /onvif://www.onvif.org/type/ptz /
>
> /onvif://www.onvif.org/location/country/taiwan /
>
> /</wsd:Scopes>/
>
> //
>
> /<wsd:XAddrs>http://172.16.23.166/onvif/device_service</wsd:XAddrs>/
>
> /<d:MetadataVersion>1</d:MetadataVersion>/
>
> /</d:Hello>/
>
> /</s:Body>/
>
> /</s:Envelope>/
>
> I do not know if the problem is that the <d:Types> is closed by a
> </wsd:Types>. I�m a bit confused with the namespaces. Maybe I must
> initialize some things in the soap struct?
The problem is that ws4d-gsoaps ws-discovery implementation won't
support such a message.
The message is not valid because auf missing namespace declarations and
opening and closing tags that are different. One example is:
<d:Types>dn:NetworkVideoTransmitter</wsd:Types>
- the namespace prefixes dn and wsd are not defined
- opening and closing a tag with different prefixes is also not valid
(d:Types and wsd:Types)
So my first suggestion would be adding a workaround to ws4d-gsoap. But
there are so many failures in this message that it is better to ask the
manufacturer to fix the problems.
Regards,
Elmar
--
*******************************************************************************
Dipl.-Inf. Elmar Zeeb
Universit�t Rostock, Fakult�t f. Informatik und Elektrotechnik
Institut f. Angewandte Mikroelektronik und Datentechnik
University of Rostock, Faculty of CS and EE
Institute of Applied Microelectronics and Computer Engineering,
18051 Rostock
Deutschland/Germany
Tel. : ++49 (0)381 498 - 7262
Fax : ++49 (0)381 498 - 7252
Email: elmar...@uni-rostock.de
www : http://www.imd.uni-rostock.de/, http://www.ws4d.org/
*******************************************************************************