Calling PB components within IIS

1
0
-1

I'm thinking about the possibility of calling PB code from a website hosted in IIS.

Is it possible to use the AJAX method to call PB code?

AJAX is based on a browser function that works similar to the PB function GetURL. Javascript code passes input variables in the URL and a server script runs in the background. When the server side script finishes, it passes the output to a Javascript function specified in the initial call. The assumption is that the output is in XML format but technically it could be any format that the Javascript in your web page can understand.

I would likely be doing this in Classic ASP which consists of hand coded HTML & Javascript on the front end and VBScript on the backend.

Question Tags: 

Answers

Chris Pollach answered Calling PB components within IIS

1
0
-1

Hi Roland;

   Food for thought ... why not have either an ASP or ASP.Net code call a PB NVUO deployed as a web service instead?

Regards ... Chris

Roland Smith's picture

It is possible to call a web service from ASP server side Vbscript but it is somewhat involved and adds a step. Calling directly from Javascript on the client would be more efficient. 

Armeen Mazda's picture

How about deploying the PB NVO as a .NET assembly and having your ASP.NET page call the assembly locally on the server-side?

Roland Smith's picture

I don't know C# or ASP.NET. The web programming I am familiar with is Classic ASP which uses vbscript on the server. I suppose I should attempt to learn it.

Roland Smith's picture
 

I did some research and to call .Net from Classic ASP VBScript it has to be a registered COM object.

The Javascript can AJAX call a small VBScript file on the server that calls the COM object function and returns the result to the browser.

Can you create a .Net Assembly from PB that is COM without a bunch of work arounds?

brad.wery@werysoft.com's picture

Create the WCF web service in PB. Host it on your server so you can access its end points. In your web page, use jQuery to call out to your webservice. It'll make everything so much easier. jQuery has a method to call web methods using ajax. Here's an example I quickly found:

http://www.c-sharpcorner.com/UploadFile/rohatash/calling-wcf-services-us...

here's the important code:

$.ajax({  
                type: "POST",  
                contentType: "application/json; charset=utf-8",  
                url: 'Service.svc/GetData',  
                success: function (data) {  
                    $($.parseJSON(data.d)).each(function (index, value) {  
                        $("#TableID").append("<tr><td>" + value.Name + "</td><td>" + value.LastName + "</td><td>" + value.Email + "</td></tr>");  
                    });  
                },  
                error: function (result) {  
                    alert(result);  
                }  
            });