I've developed a REST API back end using Endpoints-Proto-Datastore, which wraps the Cloud Endpoints Python API. I'm starting to look at Qt and trying to get an idea what will be involved in accessing my API from the Qt networking or other library. Might it be nearly as straightforward as is making the calls from the command line using the Python Client library, which even handles OAuth2 flows? This would be very nice. I might use PyQt if this makes things simpler.
Your Endpoints service can generate an OpenAPI specification file which describes the API. Once you do this, there are many OpenAPI-compatible packages which can generate client code for you.
I located this document which gives a pretty good overview for my purposes:
"The Google APIs Client Library for C++ will automatically take care of many of the tedious details for interpreting and complying with the discovery documents so that you can write simpler and familiar C++ code."
Now it's a matter of building and installing the C++ client and then figuring out how to generate the client library and access it from a Qt application. But that is beyond the scope of this question.
I want to create web application that is having some functionality to be platform independent.For that i want to create Java API, but I am confused that is the same thing can be done using jar implementing that functionality?
That are two completely different things and cannot be compared as you did.
An API is an Application Programming Interface, so it defines the methods you can use. (wikipedia link)
A JAR is a Java Archive, it is just a packaged Java Application. (wikipedia link)
An API, by definition, it's just an interface your application/library exposes to other applications to take advantage of your functionality. It doesn't impose any way of implementing it and there is no such a thing as a Java API (unless you mean you have multiple APIs for different programming languages in the form of wrappers). You can build your API just using a regular Java interface, and then pack that in a JAR other Java applications can import and use.
A rest API written in Java will return a JSON payload which can then be read and used by an application written in any programming language. This is the advantage of web services.
A jar will return Java objects as a payload, so is optimal to use if you will be using it exclusively within other Java applications.
I have a java server side project which contains JAX-WS web-services (using JavaEE 6 and the #WebService annotation).
Is there some kind of plugin that would allow me to generate Flex client stubs during my maven build ?
I have taken a look at enunciate, but it seems to generate only AMF client.
I've also tried to look at GraniteDS, but their doc seems a little opaque to me.
Notice my Flex project is compiled using flexmojos, which contains a flexmojos:generate mojo that should be able to generate domain object (however I don't understand how to say it to use domain classes from ANOTHER project, and not from a different folder).
So, is there any maven plugin that would allow the kind of feature described in this Adobe page ?
Well most solutions use the WebServices WSDL description and generate stuff from that.
I documented this process in my Wiki. Don't be confused about the CXF Part, just have a look at the "Seting Flex up as Web Service client" part. When I did this, I used the code generation features of Flash Builder to generate the code and to work with that code.
I know this is not the cleanest way to do it, but it worked then (about 2 Years ago). Things like wsld2as weren't available then ... perhaps you should have a look at that.
I am looking for approaches I can take to consume my .net SOAP service on the BlackBerry Playbook. So far I believe there are two main approaches to my problem.
Apache CXF wsdl2js
I have used wsdl2js to generate the javascript needed to communicate with the service. However I end up getting a http 500 error and have not been able to get past that. I have looked through the provided examples from the Apache CXF download and I have done some searching and cannot find a solid example of creating the javascript client. A lot of examples seem to somehow access the wsdl file at runtime from a server but my javascript is already generated from the CXF tool and I just include the scripts... if anyone has some tips here that would be great.
Adobe Flex and AS3
Another option I have considered is using Adobe Flex. I create a new Mobile Flex project in Flash Builder using the BlackBerry PlayBook SDK and Flex 4.5. However when I use the menu options to connect to a web service I get prompted with "This option is only available for flex projects."
Are there any other options out there that provide a solution to this problem? If you need more information just let me know.I understand this is a large topic, thank you for your time.
In Flex, you can use the WebService class to access SOAP WebServices. More info here.. I'm sure you can use this class for a non-Flex AS3 solution.
I'm not sure why they disable the Flash Builder tooling for this; but it shouldn't prevent you from using the actual classes to access WebServices.
I can't speak about the alternate approaches.
I have some basic experience in making Flex sites, but I think I have more use for Flex in making a desktop AIR application.
Anyway, I was wondering if it is at least possible to use C# alongside Actionscript/AIR? I can't find any example of this.
Also, can I use custom Flash components in a Flex app? I know I can use Javascript components.
Thanks
Your options with AIR are limited to HTML/JS, Flash/ActionScript or Flex. There's no support for other languages and frameworks.
You can create a C# console application and call this application from AIR.
var file:File = File.applicationDirectory;
file = file.resolvePath("CSharpConsoleApplication.exe");
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
nativeProcessStartupInfo.arguments.push("-arg");
var process:NativeProcess = new NativeProcess();
process.addEventListener(NativeProcessExitEvent.EXIT,onProcessDone);
process.start(nativeProcessStartupInfo);
In this way we have a C# application with AIR interface.
Slukse is correct -- it depends on what you mean by "alongside."
Obviously you can't compile C# code into a SWF -- that much we know. But you can certainly embed (as davr suggests) an ActiveX control into a .NET Forms app, load the SWF into that control, and use the ExternalInterface API to bridge the C# code running in the desktop app and the ActionScript code running in the SWF. If by alongside you mean writing server-side C# code to render data consumable by the Flex app, then of course, you can do that, too -- there's plenty of documentation out there covering how to connect a Flash or Flex (or AIR, by extension) app to Web Services of a variety of flavors, including the relatively new-ish WCF stuff.
Another way to go would be to run a standalone C# desktop app (e.g., a service, console app or the like) and have that app listening over a certain local port -- then have your SWF talk to that app using the Socket classes. I'm doing something like this now (with Java, not C#, but the idea's the same) for a personal project.
If by 'alongside' you mean using c# as middleware to connect to your database (probably SQL Server), or to perform remote calculations then yes you can. You can connect to a c# service using remote objects. The midnight coders produce a product called WebORB that is fairly simple to use. Version 3.4 was a totally free version that should suffice if you are building desktop applications in Air. The next two versions are not free but basically offer no real advantage to you.
The only way I know of doing this is with C# web service programs and the AIR/Flex apps communicate with the web services.
The whole point of AIR is to enable web developers who know AS/JS to be able to easily make desktop applications which are automatically portable to win, linux, and mac. Hence why there is no way to connect it to other languages like C#, C++, etc, since web developers generally don't care about those languages, and if they were used, the app is no longer portable (yes, most languages can be ported to other OS's with some effort, but the point of AIR is that you write whatever you want, and it runs everywhere with no extra work).
If you want to combine C# and Flash, instead of trying to put C# inside AIR, what you should be doing is putting Flash inside a C# app. There are various resources for this on the internets, here is one I found in a quick search: Example: Using the External API with an ActiveX container. When you are searching, make sure it talks about the newer, more advanced ExternalInterface / External API method, and not the oldschool SetVariable/CallFunction/watch method. The newer one is much easier to use & has more features.
Also, yes, you can use custom Flash components inside a Flex app. Generally you just make a SWC inside Flash CS3 (or CS4), and then import that SWC inside Flex Builder (or Flex SDK, or FlashDevelop, or ...)
If you are making the components yourself inside Flash CS3, you should use the Flex Component Kit. It provides some features for you, and puts in the boilerplate code, to make your flash component play nice inside Flex. It's included with Flex Builder/Flex SDK.