1. ATK Gimmy Susan
  2. PowerBuilder
  3. Tuesday, 7 May 2019 08:18 AM UTC

hello guru

I'm playing with Webservices and in particular with the framework: STD_FC_WebService_Framework.

Given that there is a uo_interface and a uo_controller, is it possible to have another uo_xxxxx with the related methods?

I have to convert some business roules and it is expensive to write them all in uo_controller.

If I try to create and uo_xxxxx (both in uo_interface and in a_controller) I always have an error, in the execution of the WS, to the instruction costructor uo_xxxxx

 

I attach error.

i attach the code

Attachments (2)
Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 7 May 2019 17:31 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Gimmy;

   Sorry for being late in the reply to this question. I was on customer meetings and Bugzilla this AM and have just gotten around to the Community Forum this afternoon.

   The answer is NO ... there should not be any visual object use in any Web Service component. To that end, you will not see any Visual Object classes in the STD Web Service framework. For new components, you should create them by inheriting from the current NVUO's in the framework, as follows for an MVC design implementation:

  1. Interface:  nc_interface_master  ( aka view)
  2. Controller:  nc_business_master
  3. Model:  nc_business_master

Note1:  The "Interface" object class will support the "Activate" and "Deactivate" events (by IIS) when called by the the outside world in the IIS instantiation of the thread.

Note2: The "Controller" does not have the events from note#1 as the IIS task manager will not use these for an internal object dispatch calling. Thus, the "interface" object needs to call the Controller's related methods and pass initial information to the Controller object class as required.

Note3: The "Model" object class is optional. If the business rule processing is simplex, you can implement all the business logic in the controller. If the business log is complex, then one or more Model object class(es) can be created to implement one logical encapsulated set of business rules. Thus, the "Model" object class needs to called from the Controller object class. The "Controller" would then live up its name to control (co-ordinate) the Model objects processing flow and then finally - commit the DB transaction(s) if the Model object(s) vote OK.

HTH

Regards ... Chris

 

 

Comment
  1. ATK Gimmy Susan
  2. Wednesday, 8 May 2019 07:43 AM UTC
Hi Chris.



Ty for answer.



I know that web services CANNOT have visual objects (UO) but only NON visual oblject (NVUO).

It was my transcription error from Google translator (sorry for the level of my English).



Going to the problem.



I understand that I can have other NVUOs and they must inherit from 'nc_business_master'.



Furthermore, these new NVUOs must be instantiated and called up in the controller.



It's right ?



Gmy
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 8 May 2019 14:11 PM UTC
Correct.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 7 May 2019 14:34 PM UTC
  2. PowerBuilder
  3. # 1

Hi Gimmy,

I've done a full build of the workspace and then like you said clicked the run option.

For me it seems to work, at least I'm not getting the errors you get.

See the 2 attached images.

Attachments (1)
Comment
  1. ATK Gimmy Susan
  2. Tuesday, 7 May 2019 15:13 PM UTC
My Miguel,

Ty for the time that you spend for me.



2 questions:

1- it works ( for you ). Is the create object in the post open of uo_interface ?

2- what do ypu mean with 'i've done a full build of the workspace'



ty again



GMY
  1. Helpful
  1. Miguel Leeuwe
  2. Tuesday, 7 May 2019 15:18 PM UTC
1) I have unzipped your rar file and have done no changes, so it's in the normal "constructor"

2) I've right clicked on the target "progenamws" (the workspace also works) and chose "full build"
  1. Helpful
  1. ATK Gimmy Susan
  2. Wednesday, 8 May 2019 07:44 AM UTC
Ty Miguel

i try
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 7 May 2019 14:35 PM UTC
  2. PowerBuilder
  3. # 2

here's the other one, after having clicked on the Invoke button:

Attachments (1)
Comment
  1. Miguel Leeuwe
  2. Tuesday, 7 May 2019 18:01 PM UTC
As promised. I've tried at home on windows 10 and it also seems to work.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 7 May 2019 20:26 PM UTC
Hi Miguel;

FYI: There is no need to change any registry "browser" settings to allow PB.Net web services to work.

Regards ... Chris
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 8 May 2019 04:56 AM UTC
I suspected that, but since we have such a different result, I thought "just in case". Thanks for confirming that though.

regards
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 7 May 2019 13:09 PM UTC
  2. PowerBuilder
  3. # 3

Hi, 

I seem to remember that with the STD you should code everything in some Post constructor event not in the normal constructor (but I'm sure Chris will help you out on this one).

HIH

Comment
  1. Miguel Leeuwe
  2. Wednesday, 8 May 2019 04:54 AM UTC
Thanks Chris, yes, I've experienced changes throughout different versions. Quite frustrating. Also event firing in windows seem to be different (activate?) when opening maximized or not.
  1. Helpful
  1. ATK Gimmy Susan
  2. Wednesday, 8 May 2019 09:55 AM UTC
Hi



I move my oracle connection code from controller.costructor() to controller.oe_post_costructor() and NOTHING works.

i have to leave the code in costructor.



i try a debug and.......: it seems that IT DO NOT PASS IN controller.ue_post_costructor().

Is it correct ?





  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 8 May 2019 14:04 PM UTC
Hi Gimmy;

Depending on how you wrote your WS code ... yes, you might have to ensure a DB connection in the "Constructor" event. Its not a problem to use the "Constructor" event if you have to. Especially in the Web Service framework. Its a lot more dangerous on the GUI client side where a plethora of visual object events are firing on multiple instantiations during a Open ( Window) command.

Regards ... Chris
  1. Helpful
There are no comments made yet.
ATK Gimmy Susan Accepted Answer Pending Moderation
  1. Tuesday, 7 May 2019 13:29 PM UTC
  2. PowerBuilder
  3. # 4

Ty Miguel

 

i Try to move the code in uo_interface.oe_post_costructor but the problem is alive.

 

 

The message is:

System.Web.Services.Protocols.SoapException: Riferimento a un oggetto non impostato su un'istanza di oggetto. ---> System.NullReferenceException: Riferimento a un oggetto non impostato su un'istanza di oggetto.
   in c__nc_progenamws_interface.of_test3() in c:\Ateikonsrl.Git\Hamuul\pb2cstempout\progenamws\nc_progenamws_interface.of_test3(I):riga 4
   in cns_progenamws.PBWS__nc_progenamws_interface.of_test3() in c:\Ateikonsrl.Git\Hamuul\pb2cstempout\progenamws\progenamws.asmx.cs:riga 98
   --- Fine della traccia dello stack dell'eccezione interna ---
   in Sybase.PowerBuilder.Web.WebServices.PBWebService.HandleException(Exception ex)
   in cns_progenamws.PBWS__nc_progenamws_interface.of_test3() in c:\Ateikonsrl.Git\Hamuul\pb2cstempout\progenamws\progenamws.asmx.cs:riga 108
Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 7 May 2019 13:47 PM UTC
  2. PowerBuilder
  3. # 5

Hi,

 

When I deploy p_progenamws_iis (or the ms):

I get 2 unsupported features messages

one on "Class" of runtimeError

one on "Line" of runtimeError

 

Not sure if that happens to you, I'm using pb2017r3

 

Then, how do you call the webservice? Soap? Http object?

 

 

Comment
  1. ATK Gimmy Susan
  2. Tuesday, 7 May 2019 14:05 PM UTC
Hi



try to test the ws from IDE:

p_prograwsiis / 3rd page / buton RUN WEB SERVICE.

  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 7 May 2019 18:04 PM UTC
  2. PowerBuilder
  3. # 6

Hi Chris,

I didn't realise there's a visual object involved. I don't see any in the attached RAR file, but maybe that's what's the question about.

regards,

Miguel

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 7 May 2019 20:00 PM UTC
  2. PowerBuilder
  3. # 7

Hi Miguel;

  The two unsupported features messages: 

 ---------- Unsupported features:    (3:56:51 PM)
c:\dev\pb2017\orderentry\std_fc_ws_base.pbl(ns_runtime_error_master).   Property "class" of runtimeerror is not supported.
c:\dev\pb2017\orderentry\std_fc_ws_base.pbl(ns_runtime_error_master).   Property "line" of runtimeerror is not supported.
 ---------- Finished    (3:56:51 PM)

 The framework supports the use of the RunTimeError object class in your Web Services but PB is just warning you that its .Net implementation does support using those two particular properties. All the other properties and methods are supported by PB.net. The framework does not use these two properties but as soon as any application references this object class, those two warnings appear regardless.  :-(

  aka: Not my fault - LOL!

HTH

Regards ... Chris

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 7 May 2019 20:24 PM UTC
  2. PowerBuilder
  3. # 8

Hi Gimmy;

   Please check the WebService.Log file. It should be located in the "C:\inetpub\wwwroot\progenamws_root\file\session\__webservice__\c" local IIS folder. My test with your code errors the same way but, the frameworks log points out the issue in the INI setting versus the actual PB.Net run-time, as follows:

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

***** STD Foundation Classes - Web Service Logging Started ******
STD Foundation Classes version 2018.1.0.68 was released on 2018-06-12 and is optimized for the WebService environment.
Logging was started based on instantiating interface object class - name: nc_progenamws_controller
2019/05/07 16:18:47 - ** The PowerBuilder 'run time' version found was not the one expected! **
2019/05/07 16:18:47 - PowerBuilder version found ...... 17.2.0.1880
2019/05/07 16:18:47 - PowerBuilder version expected ... 17.0.0.1769
2019/05/07 16:18:47 - Processing aborted for object ... nc_progenamws_controller

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

HTH

Regards ... Chris

Comment
  1. ATK Gimmy Susan
  2. Wednesday, 8 May 2019 09:51 AM UTC
it seems that the only solution is to have the sources in driver c:



=(
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 8 May 2019 14:09 PM UTC
Hi Gimmy;

Remember that the latter end of your specific path will be determined by where you placed your PB WS's "Workspace" as the WS deployment will use that to build the "absolute" path in the IIS deployment and subsequent related folders at run-time.

Regards ... Chris
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 8 May 2019 14:18 PM UTC
Also note that if you change the workspace location for your WS (like Drive "D") - you need to edit your Controller & Interface objects "is_wrokspace_path" property to match that location exactly (no ":" in that path BTW)!
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 7 May 2019 23:08 PM UTC
  2. PowerBuilder
  3. # 9

Hi Gimmy, Just want to make sure you are aware that those PB.NET Web services are obsolete.  It has been replaced with a 100% new implementation for .NET Core that follows open standards, designed to perform and scale, and is cross-OS.  This is available in PB 2019, which is scheduled to release on May 31, 2019.  I don't recommend using obsolete features for any new development that you do.

Comment
  1. ATK Gimmy Susan
  2. Wednesday, 8 May 2019 07:31 AM UTC
hi Mazha.

You are right, but with 2017r3 you promised me support for 60 months, and PB2018 is not alive.

=(
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Wednesday, 8 May 2019 17:02 PM UTC
Yes, but support does not mean enhancements. The other point is after such time you will need to rewrite it. So as I said, if your app is already using this then OK, but if you are developing new feature then I do not think this is wise. Anyway, just share my opinion with you.
  1. Helpful
There are no comments made yet.
ATK Gimmy Susan Accepted Answer Pending Moderation
  1. Wednesday, 8 May 2019 09:57 AM UTC
  2. PowerBuilder
  3. # 10

Another question.

When I'm developing, I have to deploy WS project many times.
Do I have to restart IIS with each publication?

 

ty

 

GMY

Comment
  1. Roland Smith
  2. Wednesday, 8 May 2019 10:50 AM UTC
Probably not. In IIS each 'Application Pool' is a separate process so if anything like that were needed, a pool recycle would be enough.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 8 May 2019 14:13 PM UTC
  2. PowerBuilder
  3. # 11

No, you can leave IIS running if its only code updates. If you change the technical structure of the WS - then I would recycle the WS just to make sure (ie changing application pools).

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