Question

I use GSOAP to implement a simple program that fullfills ONVIF discovery functionality. (The NVT, NVR part, not the Device Manager, i.e Client part)

The program needs to 1) Send "ProbeMatch" messages in response to "Probe" messages of the ONVIF DM. 2) Send "Hello" messages occasionally.

I downloaded and launched "gsoap" tool without any problem. I generated h and c files, and created a project in Eclipse.

When I generate C files in "Client" mode, I can build the Eclipse project. There are 3 functions defined in soapClient.cpp but I do not know how to use them in main function ( What are the parameters ns2_HelloType and ns2_ResolveType). And, when do I call these functions?

When I generate C files in "Server" mode, I cannot build the Eclipse project because those functions have signatures in h files but are not defined. I have to define them according to the tutorial of gsoap. (Calculator Example)

http://www.cs.fsu.edu/~engelen/soapdoc2.html

Actually, I couldn't manage to understand the concepts "Server" and "Client". Which part of the ONVIF specification is client, which is the server? Hello, Bye etc. are the functions of the "device" itself so is the device SOAP Server? Can anybody clarify those concepts?

Best Regards, Firat

Was it helpful?

Solution 2

You asked several questions. This will address only those concerning gsoap, client/server. Regarding your question: I couldn't manage to understand the concepts "Server" and "Client" , Can anybody clarify those concepts?.... So, in the most general terms:

If you are using gsoap, it is because you want to use C bindings to stitch together some component of a web service, either on the server side, or on the client side.

A simple web service Server/Client scenario:
The server, in simplified terms, listens for a request from a client, and based on some provided information from the requester (i.e. the client), queries its data source, usually a database, using the input data, packages up the requested data and returns it to the client. Think of getting the weather from your phone. Your phone, the client, sends some small piece of information such as postal code, to a known WSDL end point. The weather data is returned and displayed on your phone app.

Using gsoap it would look like this:, The request sent from your phone is simply entered as human readable text: 98873-1234, read in from an application using the gsoap C bindings into a C data structure. The C binding (C function) converts the struct data to XML SOAP format using the functionality in gsoap libraries, and sends the XML data via tcp/ip to the WSDL end point of the server. The server side gsoap libraries within an application receive this data, convert it from the XML SOAP format into C type data most likely as a member of a struct. The data is then used to build a query string to the database and make a query. The query is sent to the database. The response, XML SOAP, is again converted to C type data, and using the C bindings (C functions) provided by gsoap, sent back to the requesting client.

Again, in very simple terms it looks like this:
ServerSide database<->SQL<->gsoapApp<->tcp/ip<->gsoapApp<->userInterfaceDisplay ClientSide

There is a client application example here. Although this example is targeted toward client side applications, the concept for server side gsoap code generation is very similar.

OTHER TIPS

What kind of device are you trying to implement? A Network Video Transmitter (NVT)? In this case you need to implement the server.

The client is the part of the VMS that connects to the devices.

When you generate the server part, you need to implement the functions that do something when the correspondent function is invoked from a VMS. This is why you get a build failure.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top