Does GeneXus have the functionality to call external program's APIs? - api

I understand GeneXus has the 'External Object' feature, which I can only assume is used for setting up API calls, however, I can't seem to find any documentation online for doing this. I have an external software and I wish to run a GET API call (ie api.domain.com/example) and input the received data into a transaction in my GeneXus software. Any way of doing this?

For calling HTTP APIs you should use the HttpClient Data Type.
&httpclient.Host = "labs.genexus.com"
&httpclient.BaseUrl = "/mobilecrm/rest/"
&httpclient.Execute('GET','WorkWithDevicesCompany_Company_List_Grid?fmt=json')
&companies.FromJson(&httpclient.ToString() )
Look at this sample
External Objects are used to integrate native objects, such as External Programs packaged as DLLS (.NET) or JARs (JAVA). This seems not to be your case.

Related

Missing --create_source_map option for Closure Compiler Service API

I'm using Closure Compiler Service API to get JavaScript compiledCode. For debugging purposes on live environments I may need to have an option to get the source maps from same response if possible, similar to command line option --create_source_map: https://developers.google.com/closure/compiler/faq
Is closure compiler service API able to do that too? I could not find any arguments in this regard https://developers.google.com/closure/compiler/docs/api-ref
Thanks
The API does not currently support this. It would be good to file a issue https://github.com/google/closure-compiler but the team has not really been investing in the API. Keep in mind the API service isn't really suitable for production services as it doesn't provide any uptime guarantees or any guarantees at all really (having per minute/hour/day throttling per user and can contain breaking changes whenever the Closure Compiler is released).

Polarion Web services API - How to create a project?

Looking at the list of available polarion webservices wsdl api functions, I don't see one for creating a polarion project. I have had no luck in finding out how I can create a polarion project via scripting to the polarion soap (wsdl) API.
It is not possible.
I was looking through the (in my opinion) three relevant classes when it comes to using the API and I could not find a createProject method.
The three relevant classes are:
http://almdemo.polarion.com/polarion/sdk/doc/javadoc/com/polarion/alm/ws/client/projects/ProjectWebService.html
http://almdemo.polarion.com/polarion/sdk/doc/javadoc/com/polarion/alm/ws/client/session/SessionWebService.html
http://almdemo.polarion.com/polarion/sdk/doc/javadoc/com/polarion/alm/ws/client/tracker/TrackerWebService.html
There is a createProject method however in the following interface
but importing that did also not work. It is not part of ws/client so I think the method is only ment to be implemented in Polarion Wikipages with Velocity Code.
http://almdemo.polarion.com/polarion/sdk/doc/javadoc/com/polarion/alm/projects/IProjectLifecycleManager.html

Can you use third party .dlls in SAPUI5?

I am redesigning a Reman service, which currently exists as a thick client application that receives SAP Optimization Jobs (from SAP), calculates the best way to optimize product use (Optimizer) and display the best optimization on the client. They can either edit or submit the optimization back to SAP
I am trying to create a SAPUI5 application that either:
Reaches out to an external web server to run a small application (Optimizer) and returns the data back to the UI5 application.
or
Load the third party dll into SAP UI5 and call the Optimizer that way.
Is this possible? Can you use third party dlls in UI5?
SAPUI5 - as the name says - is a UI framework. From your description, I understand that you're trying to pull business/processing logic into the UI. This is usually considered a bad idea. You should rather put the business logic (i. e. your optimizer) into a server-side component (anything that would ideally provide OData services) and use UI5 to create a front-end for that.
It appears that in both solutions you proposed, the business logic is on the server, which is a good practice.
Although it isn't impossible to call a DLL from Javascript, it isn't a very good idea, because there is no possibility to make this browser-independent. There may even be incompatibilities between various versions of the same browser when calling DLLs.
It would by far be the preferred way to call the optimizer webservice from the UI5 application. In fact, UI5 is completely designed to facilitate calling web-services and provides various components that will help you to make the actual call and bind the returned data to user-interface controls.
it is possible as long you have the dll registered in the machine which is running the UI5 Application and you're using JScript for such.

Worklight data synchronization

We're currently working on a Worklight project using Dojo (more specifically dojox/app). We managed to create a basic example with a store, model, controller and a view. However, now we want to connect this to our Worklight adapter.
What is the best approach in connecting a Dojox/app application to the backend? We were thinking about feeding our store with the data from the Worklight adapter, however, we need to do all CRUD operations and our data should be in sync with the server because multiple users might be working at the same item.
The best general solution I can think about is using a JsonRest store, but we're using the WL.Client.invokeProcedure function that calls our adapter, so we're not directly using the service.
We found a solution by using the WL.JSONStore from WorkLight. The API of it isn't compatible with the dojo/store API (logically since it wasn't meant to be), but we wrote a dojo/store API based proxy class which does nothing more than translating and forwarding calls to the WL.JSONStore.

RESTful windows phone

How do I transfer an object in RESTful web service? it seems like RESTful only supports string to exchange data between client and service. thanks
All web services only support the transfer of a representation of objects. Given the right client, you can easily generate objects with the information passed. For example, using JSON and a javascript client with jQuery, you can easily call jQuery.parseJSON(stringFromRESTServer); (or any number of methods in other good js libraries) to get a js object.