How to define a public function in a CXP application

This forum is for conversations about Internet development using CXP, WebSockets, HttpEndPoint, etc.
Message
Author
Diego Euri Almanzar
Posts: 174
Joined: Thu Nov 05, 2020 10:51 am
Location: DOMINICAN REPUBLIC

Re: How to define a public function in a CXP application

#21 Post by Diego Euri Almanzar »

Dear Slavoljub Damnjanovic,

Excellent, now we totally agree.

Can you share here how to upload a PDF content with HTTP POST, or can you tell me where to find some reading about it?

Best regards.

Diego Euri Almanzar
Posts: 174
Joined: Thu Nov 05, 2020 10:51 am
Location: DOMINICAN REPUBLIC

Re: How to define a public function in a CXP application

#22 Post by Diego Euri Almanzar »

Hello everyone!

I have been using XBASE++ CXP for more than a year, and my application or WEB system works very well. CXP is definitely the best way to develop on the WEB. As a Web server I have used Windows IIS, as well as the option Standalone with HttpEndpoint.

With Windows IIS, it is unstable, sometimes it runs normally, but it gives a lot of errors. Especially when the application tries to use the helpers. That is, the dlls that contain the functions that I use as the interface.

The only advantage with Windows IIS, is that I have been able to upload PDF documents, and display them with iframe tags, or JS libraries for PDF handling.

The modality that has worked very well for me is Standalone with HttpEndpoint. But, I need to upload PDF documents, and via Standaone I can't do it. Obviously, I know it's happening because I don't have cloud hosting. I'm still working on a local computer.
However, I think that if I can upload PDF documents through IIS, I should also upload PDF documents through my HTTPENDPOINT server.

I think that perhaps what my httpendpoint server is missing is the use of certificates, so that the browser accepts any type of document.
The only example I found about digital certificates in combination with httpendpoint is the following:


In addition to plain text connections, HTTP end points also support servicing requests via the Secure Socket Layer (SSL) protocol. For this, an SSL certificate must first be installed on the computer. Once the end point is bound to this certificate, HTTP and web socket connections to this end point can be established via SSL for increased security.
The following code fragment demonstrates the general procedure:
#define PORT 443

// Create an end point for handling incoming
// connections on the default port for HTTPS
// Note: Port and address must be adjusted
// for your environment!
oHttpEndpoint := HttpEndpoint():new( PORT, "localhost" )

// Set the SSL certificate for the local computer.
// The certificate will be used for subsequent
// SSL connections.
// Note: The certificate must be adjusted
// for your environment!
oHttpEndpoint:setCertificate( "machine\my\mycomputer" )

// Start the end point
oHttpEndpoint:start()


The result is that it doesn't work for me. Using the setcertificate statement, just like this in the example, gives me an error. When I use it in the following way, it gives me fewer problems:
oHttpEndpoint:setCertificate(,"my","JCSERVER\APPWEB\ allsetcertificate" )

Still, it doesn't work properly.

I hope you can help me find a way to assign certificates to my website, through oHttpEndpoint:setCertificate, or any other Xbase++ tool for CXP.

I will appreciate it a lot.

Best regards.

Post Reply