1. Mark Wensel
  2. PowerServer
  3. Tuesday, 28 September 2021 23:07 PM UTC

Appeon team, 

The company I work for configured a remote IIS server for our PowerServer 2021 application.  Initially it worked on http.  When we moved it to https and added the SSL certificate we have, the following error occurs when attempting to run the application:

 

--------------------------

PowerBuilder application execution error (R0221)

Application terminated

Error: Session creation failed.

Cause: Failed to send the request (Web API: https://csesolutions.insurpas.com:5009/api/ServerApi/CreateSession)

 

The help files indicates this occurs when the server uses a proxy server to access the Internet.  There is no proxy server in the configuration.  Any ideas?

 

Thanks,

Mark

Accepted Answer
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 29 September 2021 15:35 PM UTC
  2. PowerServer
  3. # Permalink

Hi Mark,

There are a number of problems with what you are doing.

First, you cannot simultaneously have your app configured to work with a remote server and local server. In other words, if you want to use the Compile & Run feature (that is localhost) then your Web API tab needs to have localhost configured.  Make sure to do a rebuild/redeploy of the app after changing any config.

Second, the port # in the Run Options tab is not correct.  If you want to run locally (use Compile & Run Web API feature) then it should be http://localhost:80.  If you want to run the remote version, then it should be https://csesolutions.insurpas.com:5009, but then you cannot use the Compile & Run feature.

Third, you cannot use HTTPS for the Compile & Run Web APIs option.  That is just running it locally and not meant to be secure remote deployment.  So if you want to use the Compile & Run feature to quickly test locally, then in the Run Options tab and Web API tab you need to specify HTTP instead of HTTPS.

Best regards,
Armeen

 

Comment
  1. Mark Wensel
  2. Wednesday, 29 September 2021 15:52 PM UTC
Thank you Armeen for helping me understand the difference with Compile & Run for localhost vs. remote version on the production server. The application is running on localhost again. I will review more the instructions for publishing to the remote server.



Thanks,

Mark
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Wednesday, 29 September 2021 16:57 PM UTC
You're very welcome.
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 28 September 2021 23:54 PM UTC
  2. PowerServer
  3. # 1

You need to reconfigure the Web API url that is being used by the app to use HTTPS and make sure the URL/port # is correct.  

You can reconfigure the Web API URL in the project object > Web API tab and recompile and redeploy.  Or alternatively, you can use this process to modify the already-compiled app: https://docs.appeon.com/ps2021/bk03ch15s02.html

Comment
There are no comments made yet.
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 29 September 2021 01:51 AM UTC
  2. PowerServer
  3. # 2

Hi Mark,

PowerServer supports HTTPS too. Please make sure your HTTPS port is 5009 and the port is allowed on Firewall, please try the URL below on the client machine and server machine to see if there are any errors.
https://csesolutions.insurpas.com:5009

Regards,
ZhaoKai

Comment
There are no comments made yet.
Mark Wensel Accepted Answer Pending Moderation
  1. Wednesday, 29 September 2021 15:15 PM UTC
  2. PowerServer
  3. # 3

Armeen & ZhaoKai -

Thanks for the tips!  The IIS server is set to listen for https on port 443.  The Web API URL is set to https://csesolutions.insurpas.com:5009.  When the Compile & Run Web API button is clicked in PowerBuilder 2021, the following error appears in the Command Prompt window:

 

Microsoft.AspNetCore.Server.Kestrel[0]
Unable to start Kestrel.
System.InvalidOperationException: A path base can only be configured using IApplicationBuilder.UsePathBase().
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.ParseAddress(String address, Boolean& https)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses, KestrelServerOptions serverOptions, ILogger logger, Func`2 createBinding)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
Unhandled exception. System.InvalidOperationException: A path base can only be configured using IApplicationBuilder.UsePathBase().
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.ParseAddress(String address, Boolean& https)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses, KestrelServerOptions serverOptions, ILogger logger, Func`2 createBinding)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at ServerAPIs.Program.Main(String[] args) in C:\Users\markw\source\repos\PowerServer_insurpas_cse\ServerAPIs\Program.cs:line 12

 

 I attached screenshots of the Run Options and Web APIs tabs from PowerBuilder.  What configuration needs to be altered?

 

Thanks for your help!

Mark

Attachments (2)
Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 29 September 2021 15:40 PM UTC
Hi Mark;

Should the "Run Options" tab not be set to port 443 as this is the App Start URL on the Web Server and not the PowerServer URL that the App is internally using?

Regards ... Chris
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.