Welcome to the Appeon Community!

Learn, share knowledge, and get help.

 

FEATURED BLOGS

NEW ARTICLES

Free My GUI! - Multi-Threading in PowerBuilder

In this follow-up to the article titled “’Haunted Apps’ – How to Avoid Ghost (Unresponsive) Windows”, you’ll learn about the multi-threading capabilities available to PowerBuilder applications and how multi-thread...

Read more

How to create an application from object source code files using PowerBuild...

PowerBuilder can create an entire application from the object source files stored in a source code control system without relying on existing PBLs. This has been public knowledge for years, but since I cannot find the article...

Read more

Defining a PostgreSQL Database Profile in PB2019R3

PB2019R3PostgreSQL v12 database Summary:   Ensure that the database properties are defined correctly for the PostgreSQL database in the DB Painter.    If those properties are not defined correctly, the PB2019R3 IDE...

Read more

Create Multiple DSNs from a single PostgreSQL Driver

FYI - Summary:   You can create multiple databases from a single PostgreSQL driver. Details:PowerBuilder R2019R3 PostgreSQL 12Windows 10 These instructions assume that at least one PostgreSQL driver has been successfull...

Read more

Generating a QR code using QRCoder

QRCoder is an open source .Net assembly for creating QR Codes.  What we're going to do is wrap that with an assembly in SnapDevelop we can use from PowerBuilder.  First thing we need to do is create a .Net standard Class...

Read more

Detecting a smart card insertion/removal from PowerBuilder

This is a follow up article to an earlier article I wrote called Communication with a smart card from PowerBuilder. In that article I showed how to interact with a smart card once it was inserted in the reader.  In this...

Read more

FEATURED ARTICLES

REST Enhancements in PowerBuilder 2019

REST support was added to PowerBuilder in 2017 R2 and enhanced in 2017 R3.  PowerBuilder 2019 contains additional significant enhancements to REST support, including the following: RetrieveOne method – For REST methods...

Read more

Merging PDF files using PoDoFo

One PDF capability that still hasn't been introduced as a native feature in PowerBuilder is the ability to merge PDF files. We're going to look at how we can easily add that capability using the open source (LGPL) PoDoFo...

Read more

Quick start for contributing to Open Source PFC

Given that not everyone is fluent in using Git and or Github (where the Open Source PFC is hosted now), I put together a quick introduction in how to get started.  The video below walks through the steps, which in summar...

Read more

A Simple Methodology for Complex Resizing Scenarios Using the PFC

The Resize service included in the PowerBuilder Foundation Class (PFC) framework is a powerful, yet easy-to-use tool in the developer’s toolbox. Due to several factors, however, many PB developers struggle to make the Resi...

Read more

Applying a New UI Theme to Your Application

This tutorial is an update to the 2019 tutorial. If you have zero experience with the UI Theme feature, please first follow our Quick Start tutorial. If you are ready to gain a comprehensive understanding of this feature...

Read more

Implementing OAuth 2.0 Authorization with PowerBuilder 2019 R2

Introduction PowerBuilder supports getting secured data from the OAuth 2.0 authorization server. The Bearer access token is supported, and the following grant types are supported: Authorization Code Implicit Flow Client...

Read more

1.-  Creamos un objeto heredado de internetresult (Estandard Class) al cual llamaremos: nvo_internet_result.

2.- Declaramos la siguiente variable de instancia

window  lw_child //Handle

 

3.- Agregamos una función la cual llamaremos of_set_window en el objeto  nvo internet_result.

  • Recibe argumento de tipo Window (Handle)

  • Retorna un Entero

4.- Agregamos código a una función la cual debe llamarse internetdata

  • Recibe argumento de tipo blob

  • Retorna un Entero

5.-  Creamos un objeto no visual custom (Custom Class) al cual llamaremos: nvo_cws

6.- Declaramos las siguientes variables de instancia

string is_authorization

string is_endpoint

Inet  iinet_base

nvo_internet_result iir_msgbox  // El objeto creado anteriormente

string is_request

window iw_window   //Handle

 

7.- Agregamos una función la cual llamaremos of_set_endpoint.

  • Recibe argumento de tipo String

  • Retorna un Entero

8.- Agregamos una función la cual llamaremos of_set_window en el objeto cws.

  • Recibe argumento de tipo Window (Handle)

  • Retorna un Entero

 

9.- Agregamos una función la cual llamaremos of_exec en el objeto nvo_cws.

 

10.- Una vez realizadas las acciones anteriores procedemos a crear la interface gráfica.

  1. Agregamos un objeto window a nuestra aplicación con los siguientes objetos:

    1. Single line edit al cual llamaremos: sle_resource, ahí pondremos donde esta nuestro recurso.

    2. Multiline edit al cual llamaremos: mle_1

    3. CommmandButton al cual llamaremos: cb_test

    4. Y finalmente un datawindowsal cual llamaremos: dw_ws, su dataobject será un datawindow tipo external con dos campos tipo string

11.- Procedemos a poner el código en nuestra window

Agregamos el siguiente código en el evento open

obj_cws = CREATE nvo_cws

12.- Agregamos la función of_respuesta  la cual es llamada dinámicamente .

13.- Finalmente ponemos el siguiente código en el evento clicked del botón

 

Imágenes de apoyo

Aunque nuestro web service rest puede producir  json y xml por default genera el json

 

 

GlassFish 5 con el 4.1.1 generaba diversas excepciones

 

Definición del datawindow external

Comments (2)

  1. miguel riveros

where it comesthe object  lib_json.

I get an error trying to create the visual interfase:

Error C0001 Illegal data type: lib_json

Undefined variable: json

Please help where I should do corrections to the example code 

 

  Attachments
Your account does not have privileges to view attachments in the comment
 
  1. Alfredo Aldama

Hi,

You can comment this lines
//lib_Json...
//json..

With this you should retrieve since Web service

The lines commented above is for parse, and show in datawindow

  Attachments
Your account does not have privileges to view attachments in the comment
 
There are no comments posted here yet