call progress 4GL from vb.net

riku

New Member
Hi,
I am working on a solution to call progress 4GL (9.1) from a VB.NET application. One of the possibilities is to proxygen a proxy activeX component from a .r file and register this activeX component as a COM object into the VB.NET project. Then I should be able to use the proxy as a class in VB.

Does anyone know of any examples (.p and vb.net code ) that proof that this can be done?

Thanks in Advance,
riku
 

MurrayH

Member
You could also use the WebServices tool kip with SOAP messages or even SonicMQ / SonicESB. The proxy stuff definately works with VB6 - no idea about the .NET version though.

Sorry
 

agnaldo.macedo

New Member
A simpler option is the ASP call a URL of the Progress and a return XML that will be used by VB.
It is as if the ASP that a RUN in Progress program and receive data back

Vide
http://starweb-software.no-ip.info:8000/exemplo-asp/




Asp code
---------

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>Exemplo010<br><hr></div>
<asp:XmlDataSource ID="dsClientes" runat="server" DataFile="http://starweb-software.no-ip.info:8000/scripts/demo.pl/exemplos/xml/exemplo130" XPath="/dados/clientes/cliente"></asp:XmlDataSource>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="dsClientes">
<Columns>
<asp:BoundField DataField="codigo" HeaderText="Código" />
<asp:BoundField DataField="nome" HeaderText="Nome do cliente" />
<asp:BoundField DataField="cidade" HeaderText="Cidade" />
<asp:BoundField DataField="estado" HeaderText="Estado" />
<asp:BoundField DataField="pais" HeaderText="Pais" />
</Columns>
</asp:GridView>
</form>
</body>
</html>


Progress 4GL Code (/exemplos/xml/exemplo130.p)
-----------------------------------------------

{ cgi/cgi-cgi.i &carregarSuportePara="XML"}
output-content-type("text/xml").
documentoXML-AbrirDocumento("WEB").
documentoXML-Tabela("dados").
documentoXML-Registro("clientes").
FOR EACH Customer NO-LOCK:
documentoXML-CampoComAtributo("cliente").
documentoXML-AtributoDoCampo("codigo",STRING(Customer.Cust-Num)).
documentoXML-AtributoDoCampo("nome",Customer.Name).
documentoXML-AtributoDoCampo("cidade",Customer.City).
documentoXML-AtributoDoCampo("estado",Customer.State).
documentoXML-AtributoDoCampo("pais",Customer.Country).
END.
documentoXML-FecharDocumento().
 

priya

New Member
Hi,

Can anyone please guide me in getting started with the same thing.
Iam trying to connect from .net UI to progreess 4GL, retrieve and update data.

Thank you.
 

parul

Member
I think you should join the 10.2 Beta program.
In 10.2 you can use .net widgets and classes in Openedge.

Go to PSDN and search for 10.2 Beta.

-Parul.
 

jongpau

Member
Or (if you can) use v10 and its proxygen, which generates .Net compliant objects that can connect directly to the OpenEdge AppServer. No more need for J++ or Java or other stuff you needed in v9... And it also works with the (Free) Express Editions of .Net :)
 

VoxEcho

New Member
Ok, this really sounds like what i am looking for.

I am attempting to open an connection between ASP.NET and Progress. Where with classic ASP i would just do this:

<code>
dim webspeed
set webspeed = Server.CreateObject("WSASP.WSAgent")
</code>

Now when i attempt to do that in ASP.NET (C#)

<code>
Object webspeed = Server.CreateObject("WSASP.WSAgent");
</code>

i get the error:
System.Web.HttpException: Could not create an object of type 'WSASP.WSAgent'.


I've looked in IIS and the .DLL is registered and my current sites work with the Classic ASP... but not .NET


SO... can you point me in the right direction on this new
proxygen, which generates .Net compliant objects
please keep in mind that i am not a progress programmer, know nothing about progress programming and am only persuing this as i need to have something to get the dude who is the progress programmer on the right track. Thank you
 

jongpau

Member
In very short: ProxyGen is part of your Progress (OpenEdge) installation. Make sure you do have OpenEdge (version 10) and not v9 or earlier. Lookup the Proxy Generator shortcut in the OpenEdge program group. Start it and define your AppObjects that you require in .Net. You do this basically by linking a number of Progress procedures into one or more AppObjects. When done defining your AppObject, use the Generator to generate a .Net compliant dll that you can use within your .Net programs.

Use the following link to access the documentation for the Progress Open Client - you may want to send this to "the dude" as well :): http://www.psdn.com/library/kbcategory.jspa?categoryID=1921

Hope this helps.

Paul
 

VoxEcho

New Member
Excellent, thank you :) i will pass that on.

Actually, i thought i had it sorted out by doing the following:

PHP:
WSASPLib.CWSAgent webspeed = new WSASPLib.CWSAgent();
webspeed.ServiceName = "wstest";
string query = "calltime=55fdjklajfdkljfkldajfkldajflkdasjl82";
webspeed.QueryString = query;
webspeed.RunScript("programname.p");

but it just sorta hanges there as though waiting for a response. i don't know at which point it's failing, but ... is this the wrong way to do it?

-Echo
 

VoxEcho

New Member
I am in a bit of a panic on this one.

I can create the object, i can populate the .ServerName and .QueryString properties. But if i attempt to call the .RunScript method, i get either nothing at all (locks the program) or i get the following:

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at WSASPLib.CWSAgentClass.RunScript(String ScriptName)
at SignService.AddRemoteOrder(SignWebOrderCartObject oCart) in g:\WebRoot\Sign\WSDL\services\App_Code\SignService.cs:line 110
at SignService.TestOrder() in g:\WebRoot\Sign\WSDL\services\App_Code\SignService.cs:line 96


The Progress "Dude" has no understanding of Web services, or even how the WSASP.DLL Web agent works in the first place, so he is not able to help me.

- Do you think that this issue would be resoved with the Proxie thingy?

Any ideas? If i don't figure this out, i will have to make a second call from my ASP.NET app to an older ASP page to call progress... that's crazy talk.

-Echo
 

VoxEcho

New Member
jongpau you where my hero! and now you are silent. Where is jongpau?!

Ok, what i have done since:

thinking that if it would work in classic ASP it would work in VB6, i created a VB program which would load the WSASP.DLL and then attempt a simple call.

Again, the dll loads fine, and exposes it's properties as it should. i can set the QueryString and the ServiceName properties, but when i call the RunScript method i get: Method '~' of object '~' failed

some searching found that this is generally associated with a ADO connection attempt and an incompatability with ADO drivers on host computer and the Com object - e.g. they where not compiled with the same ADO files installed - so .... i am still up a creak..

Hello? Beuler?
 

VoxEcho

New Member
Well, it's been a year, and we did solve the problem. The best i can say is that we used an "app-server" (this is from our progress dude) - perhaps he will fill this in with more details.
 

tjessy

New Member
Well, it's been a year, and we did solve the problem. The best i can say is that we used an "app-server" (this is from our progress dude) - perhaps he will fill this in with more details.

hi VoxEcho,

could you send some more details about the solution? We are dealing with something similar for a while without a "real" solution! Thank you in advance! :D

John
 

itzss

New Member
I also have a similar requirement where i need to launch progress 4gl from vb.net. So anyone out there with solution please reply.
 

jongpau

Member
Hi itzss.

Can you describe your requirement some more? What sort of code do you need to launch? Is it client side stuff that requires user input or is it "just" business logic that you can pass some form of data (dataset or datatable)?

If you can provide some more information someone may be able to give you a useful answer :)

Paul
 

maynardr

New Member
Hi Itzss
Using OE 10.2b, It was simple to use ProxyGen to generate a .Net class with Strong named datasets from .P procedures. For example I used the Sports DB and BatchItems.p and OrderByCustomer.p that are available . Notice NameSpace. This is C# but VB.Net would be same approach.
View attachment 693
Then in a C# console app, I was able to Reference generated DLL and Progress.04glrt, and use them like:

private Progress.Open4GL.Proxy.Connection myConn;
private RaySports.SportsAppService myprogram;
.....
I used Progress Explorer to create an AppServer at port 3099, Agent _proapsv.exe, db is Sports, then:

myConn = new Connection(""AppServerDC://localhost:3099", "", "", "");
myprogram = new SportsAppService(myConn);
.....

To use proxy just:

RaySports.StrongTypesNS.
dsInventoryDataSet dsInventoryDataSet1 = new RaySports.StrongTypesNS.dsInventoryDataSet();
Progress.Open4GL.
Rowid lastRow = null;
Progress.Open4GL.
Rowid startRow = null;
Progress.Open4GL.
BooleanHolder done = null;
myprogram.BatchItems(
out dsInventoryDataSet1, startRow, out lastRow, out done);
.....

dsInventoryDataSet1 is a strongly named dataset that can be used easily for binding etc.

Worked well, BUT I cant seem to get to work with Oracle or SQL Server databases!, any suggestions on that anyone?

Ray






 

polar_action

New Member
attachement doesn't exist here anymore :eek:(

Can anyone shed light on what my connection to the Appserver looks like in C#. I can access the .dll but am unsure what parameters I should be using for the Appserver connection.

Many thanks,
Dave
 
Top