in

Kodigo

An all purpose Powerbuilder framework

Error calling method of a PBNI object

Last post 04-25-2009 4:50 by yeyi. 17 replies.
Page 1 of 2 (18 items) 1 2 Next >
Sort Posts: Previous Next
  • 04-17-2009 10:58

    • adeptus
    • Top 10 Contributor
    • Joined on 06-11-2008
    • Berlin, Germany
    • Posts 12

    Error calling method of a PBNI object

    Hi Yeyi,

    I am using the components from Brad Weary to redesign the whole UI of a very large application. So far everything went fine, but we stumbled upon a problem that could kill the whole project...

    Our application needs to call webservice via SOAP. To do this we use the PBSOAPCLIENT105.PBD which uses PBSOAPCLIENT105.PBX. All SOAP-Calls work fine until... we first try to open a userobject which derives from u_canvas. After the first call like "OpenUserObject (uo_toolbar)", uo_toolbar being a descendant of Brads "u_cst_toolbar" which in turn descends from u_canvas, then all further SOAP calls crash sending the message "Error calling method of a PBNI object".

    All visual components do work, there doesn't seem to be any problem with u_canvas, but I suspect that somehow, something gets derailed in the PBNI-Interface after calls to u_canvas, so that calls to objects from other PBX do not work anymore.

    Do you have any idea?

    Filed under: ,
  • 04-18-2009 3:24 In reply to

    • yeyi
    • Top 10 Contributor
    • Joined on 02-01-2008
    • Singapore
    • Posts 127

    Re: Error calling method of a PBNI object

    Hi Adeptus,

    I remember someone raised this issue to me before and we really got nowhere with the problem or they did a workaround. For your case, are you creating/calling the SOAPClient directly from a window/userobject that contains a u_canvas widget? Or are you calling SOAPClient from an NVO that is instantiated from the UI?

    I have one solution but it will require a lot of work.

    Regards

     

  • 04-18-2009 6:16 In reply to

    • Don
    • Top 10 Contributor
    • Joined on 03-11-2008
    • Posts 9

    Re: Error calling method of a PBNI object

    Hi guys,

    I had the problem calling the SOAP method from within Kodigo V 3 and it was a show stopper for me at that time too.  Good News through, I was able to get it to work.  The problem turned out to be the build of PB I was using.

    I upgraded to PB 10.5.2 build 7699 and the problem went away.

    Hope that helps! 

  • 04-20-2009 0:54 In reply to

    • adeptus
    • Top 10 Contributor
    • Joined on 06-11-2008
    • Berlin, Germany
    • Posts 12

    Re: Error calling method of a PBNI object

    HI,

    Man, am I happy to hear from you... Thanks for you answer!

     We are calling the werservice using an NVO. The first we use it, is to authenticate the user of the application. This happens before any part of the UI gets created and works perfectly. Then we start creating the UI, using lots of classes derived from u_cancas. After that, any further call of any webservice fails.

    We created a very small application which narrowed down the problem to the very first "CreateUserObject" whith a u_canvas-derived class as paramter. I can only guess, that something in the PBNI-Interface gets garbled after the first call to canvas.pbx...

    > I have one solution but it will require a lot of work.

    If you really have a solution, please let me know. We are talking about roundabout 200 Workdays that already were achieved. If we can't find a way to make it work, this would be a killer... I don't care to invest more work, if it enables us to use our new UI...

  • 04-20-2009 1:01 In reply to

    • adeptus
    • Top 10 Contributor
    • Joined on 06-11-2008
    • Berlin, Germany
    • Posts 12

    Re: Error calling method of a PBNI object

    Hi,

    Thanks for your answer!

    the first time I had this problem was indeed with 10.5.0. At this time, I used "u_canvas.create()" to test wether u_canvas would bother webservice or not. After upgrading to 10.5.2 (Build 7699) the problem was gone. (I had posted this in Brad Wearys forum).

    Unfortunately I hadn't test it with "OpenUserObject"...

    Now we are working with Build 7757, and cannot find a solution to this... I tried to go back to 7699, but the problem using OpenUserObject perseveres...

  • 04-20-2009 7:02 In reply to

    • Don
    • Top 10 Contributor
    • Joined on 03-11-2008
    • Posts 9

    Re: Error calling method of a PBNI object

    << We are calling the werservice using an NVO. The first we use it, is to authenticate the user of the application >>

    My assumption is that you are doing the user authentication to avoid a "logon" window?  You might want to consider changing the sequence of things in your application start up...so that the UI (or part of it at least) is created before the authentication.   (assuming again that you are doing some form of windows authentication.)

    Some of the 10.5 builds do have a problem with PBNI.   I noticed it from the IDE as restarting PB often cleared things up "the first time" and then all calls to the nvo would fail after that...until you restarted PB again.  

    << "CreateUserObject" whith a u_canvas-derived class as paramter >>  and << "u_canvas.create()" >>

    I don't understand what your webservice NVO has to do with u_canvas???  They are separate things.  I don't think I would be doing "u_canvas-derived class as a parameter".  What does u_canvas have to do with a webservice?

    I do have NVO webservice objects (both EasySoap and .NET) working in a large Kodigo V3 application successfully using 10.5.2 build 7699.

  • 04-20-2009 8:14 In reply to

    • adeptus
    • Top 10 Contributor
    • Joined on 06-11-2008
    • Berlin, Germany
    • Posts 12

    Re: Error calling method of a PBNI object

     Hi,

    Thanks for your answers!

       >Some of the 10.5 builds do have a problem with PBNI.   I noticed it from the IDE as restarting PB often cleared things up
       >"the first time" and then all calls to the nvo would fail after that...until you restarted PB again.  

     Yes, yes, yes!!!  I am so happy to hear you say this!!! I realy thought, I am crazy, when I found out about this! But this seemed to be solved with 10.5.2 (7699).

       > << "CreateUserObject" whith a u_canvas-derived class as paramter >>  and << "u_canvas.create()" >
       >I don't understand what your webservice NVO has to do with u_canvas???  They are separate things.
       >I don't think I would be doing "u_canvas-derived class as a parameter".
       >What does u_canvas have to do with a webservice?

    Well, nothing indeed... ;-)

    Our webservices are called using normal NVOs. Its just, that once instances of u_canvas (or one of its derived classes) are created (because the UI gets instanciated and created), any subsqeuent call to webservices using the same NVOs as before fail and throw "Error calling method of a PBNI object".

    Since webservices are used for many more things than just for user-authentication, changing the order of the calls won't help. Even if I create the whole UI before triggering the very first webservice call (authenticating) and all the following ones, there will be a point of time in the application where new UI-Objects will be created. After that, further webservice calls would fail again... :-(

       > I do have NVO webservice objects (both EasySoap and .NET) working in a large Kodigo V3 application successfully using 10.5.2 build 7699

    This is reassuring news... somehow... So what could it be? Could it really be the fact, that we are using Build (7757)? If so? Do you know if I have to deinstall the whole PB 10.5 before applying all updates until 7699 is reached or can i just install the 7699-patch over 7757?

    You said your are using "Kodigo V3". Is that the same as using the components from Brad Weary? Do both system use the same version of "canvas.pbx"? Mine is from April 13th, 2007 (53.248 bytes).

    Thanks for any further support!

  • 04-20-2009 9:34 In reply to

    • Don
    • Top 10 Contributor
    • Joined on 03-11-2008
    • Posts 9

    Re: Error calling method of a PBNI object

    Hi adeptus,

    I have been using PB since the 1.0 days...and I have never "gone backwards" when applying an EBF.   In theory, if you Unistall PB (on a development machine) and then reinstall from the CD's..and then move to 10.5.2 build 7699, that should completely remove 7757.    Based upon all the testing that I did, the problem is with PBNI and If I remember correctly, once I had it working with 7699, I stopped testing other EBF's.    I was happy to have it solved!

    I do not use Brad's controls, as I wanted to have a "framework" to work with.  I did spend plenty of time to have a "PFC" and Kodigo framework Merger.  I stripped out the parts of PFC that I needed and merged that into Kodigo, using the Kodigo services wherever possible to minimize the parts of PFC that I needed.   Also, I don't use the "pbx", I use "fcxpbni.pbd" in Kodigo.   I don't know if that's the same as what Brad has based his controls on? 

    << Mine is from April 13th, 2007 (53.248 bytes) >>  The canvas.pbx that I have is: 49,152 bytes created on July 11, 2006.

    I hope that helps a bit more.

  • 04-21-2009 0:49 In reply to

    • adeptus
    • Top 10 Contributor
    • Joined on 06-11-2008
    • Berlin, Germany
    • Posts 12

    Re: Error calling method of a PBNI object

     Brads Controls are based on "canvas.pbx". He claims, that this PBX file stems from yeyi and kodigo, but I don't know what the "relationship" is...

    @Yeyi: Could you give some more information about those files (Canvas.Pbx and fcxpbini.pbd)?

  • 04-21-2009 5:00 In reply to

    • yeyi
    • Top 10 Contributor
    • Joined on 02-01-2008
    • Singapore
    • Posts 127

    Re: Error calling method of a PBNI object

    @Don

    Thanks for helping out adeptus with his issues. Since I have not used PBSOAP in any of my projects, I can offer little insight on that matter.

    @Adeptus

    Regarding canvas.pbx and fcxpbni.pbd, in PB9 and 10, you create a DLL and compile with the PBNI libraries to an extension of "PBX". Canvas.pbx is esentially a "visual" PBNI (ther eis also a non-visual PBNI like PBSOAP, etc). It was also required to build a PBD from this PBX to be used in PB9-10 and both files should be there for it to work. It wasn't unitl PB 10.5 was there an option to actually reference the PBX directly without building a PBD. I'm not sure how that works since I never used 10.5 but it should be in the help files.

    Now there are difference between Canvas.pbx of Kodigo and Brad's AdvGUI controls. In Brad's version, we added support for transparency (or parent painting if you will via WM_PRINTCLIENT) w/c he uses exensively for transparency purposes (overlapping canvas, etc). I also gave him the source so I'm not sure if he has evolved the code further.

    Regarding the "other" solution I mentioned, it is a matter of abandoning PBNI altogether. This is also the approach I chose for v4 (works extremely well). Now the trick is how to make AdvGUI controls work using without PBNI. In the early days of Brad's site, I was trying to develop a new canvas that is backward compatible but does not use PBNI. It works well with Kodigo but not so well with AdvGUI because of transparency issues. Anyway, the reason I took this approach is to further the compatibility of Kodigo and AdvGUI to earlier versions of PB, theoretically up to PB7. The tech used is PB's external VUO. But we no longer pursued it and decided it best to stick to PB10 and above.

    So if you think you are out of options regarding EBF's and whatnot, then maybe we can try salvaging that project. But it would require a lot of time to test as far as AdvGUI controls go and fixing them might require Brad's help or someone with deep understanding of his controls. Kodigo and AdvGUI approaches are quite different because the goals are different.

    Anyway I'll try to dig out that working non-PBNI Canvas. I know had a v3 Kodigo running it somewhere in my archives.

  • 04-21-2009 9:26 In reply to

    • adeptus
    • Top 10 Contributor
    • Joined on 06-11-2008
    • Berlin, Germany
    • Posts 12

    Re: Error calling method of a PBNI object

     > Anyway I'll try to dig out that working non-PBNI Canvas. I know had a v3 Kodigo running it somewhere in my archives.

     It that could work, it would be great! My distrust towards PBNI is growing by the minute...

  • 04-22-2009 2:45 In reply to

    • adeptus
    • Top 10 Contributor
    • Joined on 06-11-2008
    • Berlin, Germany
    • Posts 12

    Re: Error calling method of a PBNI object

    Ok,

    some news: We are working with techservice from SyBase to solve this too. They built us a small visual PBX which did noting but write "Hello, world". Using this PBX, there were no problems regarding SOAP.

    So it looks like, there is something wrong with CANVAS.PBX. Mine is dated Apr. 13th 2007. Is there a newer one? 

    Brad was so kind to send me the source of CANVAS.PBX. I forwarded it to SyBase and they brought up the fact, that it didn't seem to be UNICODE-compatible (missing pragma or somethin in the code or something like this). I don't know much more about UNICODE than the fact that it uses 2 bytes per character, but I can imagine that this alone could cause problems if the other side uses just 1 byte per character...

    Could someone build a UNICODE-compatible version of canvas.PBX? Yeyi?

  • 04-22-2009 7:22 In reply to

    Re: Error calling method of a PBNI object

     Maybe it's totally irrelevant , but what does a Visual object have to do with Unicode?

     I am a total noob on C++ but the only string I saw in there was the "ClassName" and "EventName".

     Also do you have a PB 10.5 generated PBX?

    I found the canvas.pbx sources somewhere and rebuilt it for you using (on Vista)  VS 2008 and PB 10.5.2 7826 SDK.

    You can get it from here:

     http://www.4shared.com/file/101080516/a32aa2b9/Canvas.html

    Hope this helps.

  • 04-23-2009 8:39 In reply to

    • adeptus
    • Top 10 Contributor
    • Joined on 06-11-2008
    • Berlin, Germany
    • Posts 12

    Re: Error calling method of a PBNI object

    Thanks for the PBX. Unfortunately it kept bringing up the same problem...

    But... With the help of SyBase we finally figured it out. It was really related to Unicode.

    I had got the source of canvas.pbx from Brad and did forward it to SyBase. There they made some little adjustment so that all strings (constants, variable, parameters, ...) became unicode-strings, compiled it anew and send me the resulting canvas.pbx.

     Well, what can I say... it works!!!!

     I can now call as many SOAP-Calls as I want and use every control Brad as to offer...

    @Yeyi: I could send you their code, so you could check the small differences, and create a new canvas.pbx. Or I could send you my (or better their) canvas.pbx...

    @all: Thanks for all your support during some of the bleakest days in my professional life...

  • 04-23-2009 23:28 In reply to

    • yeyi
    • Top 10 Contributor
    • Joined on 02-01-2008
    • Singapore
    • Posts 127

    Re: Error calling method of a PBNI object

    That's great! Glad to hear your problems are solved. Please send the code when you have time, also, let Brad know, he may need to refresh his version of Canvas.pbx as well.

    I'll make a new build and update the download on this site for v3.

Page 1 of 2 (18 items) 1 2 Next >
Gabriel Abulencia dela Torre 2008
Powered by Community Server (Non-Commercial Edition), by Telligent Systems