1. Roland Smith
  2. PowerBuilder
  3. Monday, 13 August 2018 18:34 PM UTC

Using PB 2017-R3...

My customer has code written in C# (by a consultant) running in IIS that takes JSON data from their external customer and stores it into the database. My customer wants to write some code in PowerBuilder to process the data and return a status code to the C# code so that it can return the status code to the external customer.

What would the best way of doing this be in PB 2017-R3?

 

Kevin Ridley Accepted Answer Pending Moderation
  1. Monday, 13 August 2018 20:27 PM UTC
  2. PowerBuilder
  3. # 1

Hi Roland,

 Can you elaborate when you say "return a status code to the C# code so that it can return the status code to the external customer"?  You don't want to have a status code column on the table that stores the JSON and just update that when you've done the PB work?  I'd probably do that and have the PB process read the records with a "x" status set by C#, set the status to "y", process the records, set to "z" then have a C# batch process that reads the table looking for the "z" status code, then set to complete when successfully transmitted, or just transmit from PB would probably be even better.

 

Kevin

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 13 August 2018 20:51 PM UTC
  2. PowerBuilder
  3. # 2

I don't have the details on the C# code, it just needs to know if the data was processed or not. You are right, the PB code could set a status column on the table which could be read by the C# code. It could then return some value to the calling process.

The main purpose of my post is to determine how best to deploy the PB code into IIS using PB 2017-R3. The C# code needs to be able to run the PB code, wait for it to finish, and then return some value to the calling process so it would know if it was processed or not.

If PB 2017-R3 has the ability to generate a .Net Assembly, the C# code could be modified to call the PB code just as it would any other assembly method. I'm not familiar with PB .Net functionality.

 

Comment
  1. Kevin Ridley
  2. Tuesday, 14 August 2018 11:49 AM UTC
Ok gotcha. If it needs to be a synchronous process between the external/C#/PB code you're probably going to need to deploy the PB code as a .NET/SOAP web service or a .NET assembly, at least until PB2018. Create a new .NET web service target or .NET assembly target. It's fairly easy to do and very much like EA Server components. Then your C# app can call either synchronously and return whatever it needs. With PB2018 you can create RESTful web services, so that would give you even more flexibility.



I was originally thinking asynchronous and setting the flag in the db, but either way will work. In that case you could easily create a standard batch PB app, but the C# would have to poll the db which it sounds like you don't want. Good luck, I know with your experience you'll have it working in no time!



Kevin
  1. Helpful
  1. Song Li @Appeon
  2. Wednesday, 15 August 2018 01:20 AM UTC
Kevin is right. Adding to Kavin’s post: news features (such as JSONGenerator, JSONParser, RESTClient, etc.) added since PB 2017 are not supported by .NET/SOAP web service and .NET assembly, so they probably cannot handle Jason data easily and efficiently.



And a new C# Web APIs technology will be introduced in PB 2018, which will empower you with the ability for simpler, more powerful integration with other systems.



Best Regards,

Song
  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.