Adwo
Adwo

Reputation: 193

WS-Discovery & gSOAP set up in VS2013

My overarching goal is to create a small ONVIF client for getting camera information in either C or C++.

gSOAP seemed like a good candidate and first thing I wanted to achieve was to make a small console application which would list the addresses of a bunch of cameras I have on my network using WS-Discovery, something I've done before with a little .NET application.

The problem is I'm stumbling at the first hurdle and I'm a touch confused as to what I'm supposed to be doing. I started out by doing the following:

wsdl2h.exe -o WSDiscovery.h WS-Discovery.wsdl http://www.w3.org/2006/03/addressing/ws-addr.xsd

soapcpp2.exe -i -C -Iimport WSDiscovery.h -d output

, I then made a project from the resulting soapC.cpp stdsoap2.cpp soapH.h soapStub.h. Adding in threads.h wsaapi.h wsddapi.h threads.c wsaapi.c wsddapi.c from gsoap

This doesn't compile however giving:

wsaapi.h(134): error C2061: syntax error : identifier 'wsa__FaultSubcodeValues'

I think I'm going very wrong here and I'm confused about exactly what a 'plugin' is in the context of gSOAP (my experience with external libraries like this is extremely limited and I have no real formal training in CS). Am I just supposed to be doing what I'm doing now with the wsdd files or are they supposed to be used as part of the soapcpp2.exe process? Am I actually supposed to be using wsdl2h.exe if I just want WS-Discovery?

I can't really make sense of the documentation and don't understand how I'm supposed to get this working. Some help would be greatly appreciated so I can crack on with the actual hard part!

Upvotes: 0

Views: 1475

Answers (1)

mpromonet
mpromonet

Reputation: 11942

I guess the problem is coming from usage of WS-Addressing plugins (wsaapi.h/.c) with http://www.w3.org/2006/03/addressing/ws-addr.xsd schema.

gSOAP contains the wsdl2h generated file that could be used by WS-Discovery plugins (wsddapi.h/.c).

  • [GSOAP_DIR]/import/wsdd10.h for WS-Discovery 1.0 2005 that use WS-Addressing 2004/08
  • [GSOAP_DIR]/import/wsdd.h for WS-Discovery 1.1 2009 that use WS-Addressing 2005/08

As ONVIF use WS-Discovery 1.0 you could generate discovery implementation using :

soapcpp2 -Cx [GSOAP_DIR]/import/wsdd10.h -I [GSOAP_DIR]/import -d output

Next you should be able to build your project including wsddapi.c wsaapi.c soapClient.cpp soapC.cpp

You can find some of my experiments from github ws-discovery

Upvotes: 2

Related Questions