ONVIF: Which wsdl files are needed for Profile S - c++

I am trying to write an ONVIF client in C++ using gsoap. The executable wsdl2h will generate the needed header and the rest I think I understand.
My question:
Which wsdl files will I need, if I want my client to work with a device that supports ONVIF Profile S (let's say the mandatory specs)? Most importantly, how do I find that out? Is there a one-to-one link? Also, because I am behind a proxy and I can't seem to get that to work, can I somehow download all the needed wsdl files in a bunch?

Here's a list of .wsdl files I found...
https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl
https://www.onvif.org/ver10/events/wsdl/event.wsdl
https://www.onvif.org/ver10/media/wsdl/media.wsdl
https://www.onvif.org/ver20/media/wsdl/media.wsdl
https://www.onvif.org/ver10/recording.wsdl
https://www.onvif.org/ver10/display.wsdl
https://www.onvif.org/ver10/receiver.wsdl
https://www.onvif.org/ver10/deviceio.wsdl
https://onvif.org/onvif/ver20/ptz/wsdl/ptz.wsdl
https://www.onvif.org/onvif/ver10/search.wsdl
https://www.onvif.org/ver10/replay.wsdl
https://www.onvif.org/ver10/advancedsecurity/wsdl/advancedsecurity.wsdl
https://www.onvif.org/ver20/imaging/wsdl/imaging.wsdl
https://www.onvif.org/ver10/analyticsdevice.wsdl
https://www.onvif.org/ver10/thermal/wsdl/thermal.wsdl
Hope this helps!

There is not a WSDLfile that automatically includes all the WSDL files you may need.
If you check the ONVIF Profile S page, you will find the Profile S specification. As you can see from the PDF, there are some functions that are mandatory for a client to be conformant, others are conditional mandatory (you have to implement them if you want to claim support for those features) and some are optional.
After you choese what you want to support, you need to include the WSDL files for the services that you must implement.

Related

How to provide file download feature in a Wt based web application?

I have a web application developed using Wt framework in C++. I have some files on local disc and I want to provide file downloading functionality in my web application. Anyone's help through this will be helpful. Thank you!
Two methods exists two provide access to static files:
Specifying the docroot location (= folder containing the static files) as a command line argument. See the Wt: Library overview for more information. This approach is mostly used for images, css files, ...
Using a Wt::WResource (or f.ex. the specialised Wt::WFileResource). Advantage of this approach is that you could limit the access to those (static) resources to specific users only. This approach could also be used to download on the fly generated resources.

How can I compile my ColdFusion code for sourceless distribution, and have it be unreadable?

I've been tasked with creating a deployable version of a ColdFusion web app to be installed on a clients server. I'm trying to find a way to give them a compiled version of our code, and my first inclination was to use the CFCompile utility that I found here. However, after running CFCompile, most of the code in the CFM files is still readable. The only thing that appears to be obfuscated at all is the actual ColdFusion code - all of the SQL Queries are still perfectly readable. (Example in the screenshot below)
The HTML and JavaScript are also still readable in the compiled code, but that doesn't matter as those can be seen in a web browser anyways.
Is there another way to distribute my source code in a format that is completely unreadable to the user? I'm guessing that for whatever method I choose, there will be some way of decompiling the code. That's not an issue, I just need to find a way to make it more difficult than opening the file and seeing the queries.
Hostek has a pretty good write up on the subject over on their site - How to Encrypt or Compile ColdFusion Files.
Basically, from that article:
Using cfcompile.bat
The cfcompile.bat utility will compile all .cfm and .cfc files within a given directory into Java bytecode. This has the effect of making your source code unreadable, and it also prevents ColdFusion from having to compile your ColdFusion files on first use which provides a small performance enhancement.
More details about using cfcompile.bat can be found in ColdFusion's Documentation
Using cfencode.exe
The cfencode.exe utility will apply basic encryption to a specific file or directory. If used to encrypt a directory, it will apply encryption to ALL files in the directory which can break any JS, CSS, images, or other non-ColdFusion files.
They do also include this note at the bottom:
Note: Encrypting your site files with cfencode does not guarantee absolute security of your source code, but it does add a layer of obfuscation to help prevent unauthorized individuals from viewing the source.
The article goes on to give basic instructions on how to use each.
Adobe has this note on their site regarding cfencode:
Note: You can also use the cfencode utility, located in the cf_root/bin directory, to obscure ColdFusion pages that you distribute. Although this technique cannot prevent persistent hackers from determining the contents of your pages, it does prevent inspection of the pages. The cfencode utility is not available on OS X.
I would also add that it will be trivial for anyone familiar with ColdFusion to decode anything encoded with this utility because they also provide the decoder.

how to call web service functions

Nowadays, we see that some APIs are provided as web services. For example, ONVIF provides APIs in wsdl and xsd files from which gsoap generates sources. My question is that regardless of the context for which the API is generated, can we rely only on the wsdl and xsd files or we need some additional documents to know how to call and use these generated classes, functions and in the whole these generated cpp codes? In another words, can the xml files suffice for extracting the information of how to call the generated codes and use them?
If just having the wsdl and xsd files are enough, please tell me how to extract these information.
No, with the wsdl files, you can only create the classes and methods.
Normaly the names are the same as the element names in the soap request.
So you can look there how and witch method you have to use.
The xsd file is only to verify the request, if they are in a valid format.
A documentation would be helpfull. Without one, you have to try and error.

Are there tools for generating the clients model from an odata metadata?

Back in the good old days of flex (anyone?) flash builder provided a tool for generating the clients model based on the server model. Is there something similar for generating, say an ember's app model, based on the odata metadata?
datajs documentation does mention the subject. Though the reference for OData.read used in the sample doesn't say explicitly that it interprets the metadata somehow, it seems implied. You'll have to verify that.
It does take an optional metadata object however, suggesting there exists a formal representation for metadata to the library -- I would imagine generated via OData.read. Documentation seems non-existent. I don't know what that looks like.
From there, you should be able to further transform the model to something suitable for Ember.
(datajs is a low-level javascript library that implements client-side OData operations.)
I also know that JayStack provides a JaySvcUtil, a CLI process assembly (.NET program) that extracts metadata. The destination format is JavaScript code, though the model it uses is specific to JayData. Still, you may be able to work from there.
As mentioned by Maya, Microsoft provides the OData Client Code Generator, which generates .NET proxies. Might be more difficult to transform that.
If none of these work for you (which is actually likely), you can always parse the $metadata resource yourself -- I believe it always uses an XML representation in all current versions of OData.
If you need to do it dynamically in the browser, use DOMParser or XMLHttpRequest. More information.
If you can do it statically, then by all means do so -- it's simply best for performance. In this case, you can use whatever language and runtime tools you want to fetch, parse, transform and re-serialize the model.
The format (CSDL) is specified for OData here (v4) and here (v3).
Finally, check out this list, something new may appear that better fits your needs.
There are two suggestion which may help you.
1, OData provide client code generator to generate client-side proxy class. Just need to pass metadata url, .net client code will be generate for you. You can follow the following blog:
http://blogs.msdn.com/b/odatateam/archive/2014/03/11/how-to-use-odata-client-code-generator-to-generate-client-side-proxy-class.aspx
2, If the model means "EdmModel", you can just de-serialize $metadata. OData reader can de-serialize the $metadata to IEdmModel, which can be used in client side. The following is sample code:
HttpWebRequestMessage message = new HttpWebRequestMessage(new Uri(ServiceBaseUri.AbsoluteUri + "$metadata", UriKind.Absolute));
message.SetHeader("Accept", MimeTypes.ApplicationXml);
using (var messageReader = new ODataMessageReader(message.GetResponse()))
{
Model = messageReader.ReadMetadataDocument();
}

How to retrieve a list of files of given repository (MirrorBrain)?

The repository I am asking is for Linux, but my problem is related to client -- i.e. with retrieving those data, and client can be Linux, Windows, Mac OS X, etc. So I opted against asking this question on Unix&Linux site, if admins feel it should be U&L question please move it to the other site.
Consider such repository as http://download.opensuse.org/repositories/LCD/openSUSE_11.4/x86_64/ -- you can fetch the html for it, parse it, and get the list of files. However I hardly believe it is correct way -- since the html is created by website engine (MirrorBrain in this case), there should be some web service API to get this list directly.
I googled, but didn't find anything relevant.
So -- how to get the list of the file directly, no parsing, just call, and getting the collection of file names.
MirrorBrain doesn't have an API call to retrieve a list of files. (It only has API calls to retrieve a list of mirrors for a single file, by appending .mirrorlist or .meta4 to a file's URL.) It would be a worthwhile idea to add such an api call (patches welcome!).
So there's only the standard HTTP server directory index to read a file list from. The format varies from server to server, and even Apache has different variants. With Apache, a little trick that can help is to append ?F=0 to the directory URL if you want to get only the filenames (it will simplify the index), or to append ?F=1 to switch to the fancier variant which includes more details.
Hope this helps.