OpenEdge.Net.pl - Forum - OpenEdge Development - Progress Community
 Forum

OpenEdge.Net.pl

This question is not answered

Hi,

I am trying to use OpenEdge.Net.pl. The propath is C:/JCA/OpenEdge.Net.pl and I have include the libray, compiler is giving below error messages:

Impossibile trovare la classe o interfaccia OpenEdge.Net.HTTP.RequestBuilder. (12886)

** Impossibile interpretare linea 1. (196)
Impossibile trovare la classe o interfaccia OpenEdge.Net.HTTP.IHttpRequest. (12886)
** Impossibile interpretare linea 2. (196)
Tipo di dati specificato non valido: IHttpRequest. Specificare un tipo di dati come 'character' o il nome di una classe. (5638)
** Impossibile interpretare linea 5. (196)

OpenEdge V. 11.7 and OS - Windows.

Thanks in advance,

G.

All Replies
  • This works for me, 11.7.2 – what‘s the output of the Message-Statement? Mind sharing your source code?
     
    DEFINE VARIABLE o AS OpenEdge.Net.HTTP.RequestBuilder NO-UNDO .
     
    MESSAGE SEARCH ("OpenEdge/Net/HTTP/RequestBuilder.r")
        VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.
     
    Von: Giancarlo Alberto Somma <bounce-obonelinux@community.progress.com>
    Gesendet: Mittwoch, 9. Mai 2018 17:55
    An: TU.OE.Development@community.progress.com
    Betreff: [Technical Users - OE Development] OpenEdge.Net.pl
     
    Update from Progress Community
     

    Hi,

    I am trying to use OpenEdge.Net.pl. The propath is C:/JCA/OpenEdge.Net.pl and I have include the libray, compiler is giving below error messages:

    Impossibile trovare la classe o interfaccia OpenEdge.Net.HTTP.RequestBuilder. (12886)

    ** Impossibile interpretare linea 1. (196)
    Impossibile trovare la classe o interfaccia OpenEdge.Net.HTTP.IHttpRequest. (12886)
    ** Impossibile interpretare linea 2. (196)
    Tipo di dati specificato non valido: IHttpRequest. Specificare un tipo di dati come 'character' o il nome di una classe. (5638)
    ** Impossibile interpretare linea 5. (196)

    OpenEdge V. 11.7 and OS - Windows.

    Thanks in advance,

    G.

    View online

     

    You received this notification because you subscribed to the forum.  To stop receiving updates from only this thread, go here.

    Flag this post as spam/abuse.

    Das Bild wurde vom Absender entfernt.
     

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • is a simple code from Progress documentation. I copy openedge.net.pl from  C:\JCA\OpenEdge\gui\netlib

    USING OpenEdge.Net.HTTP.RequestBuilder.

    USING OpenEdge.Net.HTTP.IHttpRequest.

    DEFINE VARIABLE httpUrl AS CHARACTER NO-UNDO.

    DEFINE VARIABLE oRequest AS IHttpRequest NO-UNDO.

    httpUrl = "http://www.progress.com".

    oRequest = RequestBuilder:Get(httpUrl)

                      :Request.

  • What does the message statement from my previous sample say? When that says ? your PROPATH setting is not correct.

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • And for some confirmation that it really does work see: abldojo.services.progress.com:443/

  • I found the problem. It's not enough to save library on propath folder, but insert it in the propath string (PROPATH=c:\jca,c:\jca\xml,c:\jca\OpenEdge.Net.p)

    Many thanks.

  • Hi,

    I run this program:

    USING Progress.Json.ObjectModel.JsonObject.

    USING Progress.Json.ObjectModel.ObjectModelParser.

    USING Progress.Lang.Object.

    USING OpenEdge.Core.WidgetHandle.

    USING OpenEdge.Core.String.

    USING OpenEdge.Net.HTTP.IHttpRequest.

    USING OpenEdge.Net.HTTP.IHttpResponse.

    USING OpenEdge.Net.HTTP.ClientBuilder.

    USING OpenEdge.Net.HTTP.RequestBuilder.

    DEFINE VARIABLE oRequest AS IHttpRequest NO-UNDO.

    DEFINE VARIABLE oResponse AS IHttpResponse NO-UNDO.

    DEFINE VARIABLE oEntity AS Object NO-UNDO.

    DEFINE VARIABLE lcHTML AS LONGCHAR NO-UNDO.

    DEFINE VARIABLE hXmlDoc AS HANDLE NO-UNDO.

    oRequest = RequestBuilder:Get('obsv:5493/.../Clients')

                   :Request.

    oResponse = ClientBuilder:Build():Client:Execute(oRequest).

    oEntity = oResponse:Entity.

    MESSAGE

       oResponse:StatusCode SKIP

       oResponse:StatusReason SKIP    

    VIEW-AS ALERT-BOX.

    IF TYPE-OF(oEntity, JsonObject) THEN

       CAST(oEntity, JsonObject):WriteFile('temp/entity.json', true).

    ELSE

    IF TYPE-OF(oEntity, WidgetHandle) THEN

    DO:

       hXmlDoc = CAST(oEntity, WidgetHandle):Value.

       hXmlDoc:save('file', 'temp/entity.xml').

    END.

    ELSE

    DO:

       IF TYPE-OF(oEntity, String) THEN

          lcHTML = CAST(oEntity, String):Value.

       ELSE

          lcHTML = oEntity:ToString().

       /* Change extension per the Response's ContentType */

           CASE oResponse:ContentType:

           WHEN 'application/json' THEN

               COPY-LOB lcHTML TO FILE 'temp/entity.json'.

           WHEN 'text/html' THEN

               COPY-LOB lcHTML TO FILE 'temp/entity.html'.

           OTHERWISE

               COPY-LOB lcHTML TO FILE 'temp/entity.txt'.

        END CASE.

    This string return a correct XML but OE cannot save as 'temp/entity.xml" but a simple txt file that contain "OpenEdge.Core.ByteBucket_7196".

    May can help me?

  • You will want to replace

    IF TYPE-OF(oEntity, String) THEN
          lcHTML = CAST(oEntity, String):Value.
       ELSE
          lcHTML = oEntity:ToString().
    

    With something like

    case true:
      when type-of(oEntity, String) then
        lcHTML = cast(oEntity, String):Value.
      
       when type-of(oEntity, Memptr) then 
         lcHTML = cast(oEntity, Memptr):GetString(1).
    
       when type-of(oEntity, ByteBucket) then 
         lcHTML = cast(oEntity, ByteBucket):GetString().
    
       otherwise
         lcHTML = oEntity:ToString().
    end case.

    That should get you want you're after/

  • Thanks Peter. I replaced but I found error for Memprt:

    Impossibile trovare la classe o interfaccia Memptr. (12886)

    TYPE-OF 'Memptr' non consentito. TYPE-OF di destinazione deve essere di tipo definito dall'utente. (14447)

    **  Impossibile interpretare linea 47. (196)

    Thanks  a lot.

  • Did you add
     
    USING OpenEdge.Core.* .
     
    ?
     
    Von: Giancarlo Alberto Somma <bounce-obonelinux@community.progress.com>
    Gesendet: Mittwoch, 9. Mai 2018 20:03
    An: TU.OE.Development@community.progress.com
    Betreff: RE: [Technical Users - OE Development] OpenEdge.Net.pl
     
    Update from Progress Community
     

    Thanks Peter. I replaced but I found error for Memprt:

    Impossibile trovare la classe o interfaccia Memptr. (12886)

    TYPE-OF 'Memptr' non consentito. TYPE-OF di destinazione deve essere di tipo definito dall'utente. (14447)

    **  Impossibile interpretare linea 47. (196)

    Thanks  a lot.

    View online

     

    You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

    Flag this post as spam/abuse.

    Das Bild wurde vom Absender entfernt.
     

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • USING OpenEdge.Core.* .

    now work fine. Create entity.txt that contains XML structure data.

    Why do not create direcly entity.xml?

    Thx.

  • Because of this CASE statement
        /* Change extension per the Response's ContentType */
    
           CASE oResponse:ContentType:
    
           WHEN 'application/json' THEN
    
               COPY-LOB lcHTML TO FILE 'temp/entity.json'.
    
           WHEN 'text/html' THEN
    
               COPY-LOB lcHTML TO FILE 'temp/entity.html'.
    
           OTHERWISE
    
               COPY-LOB lcHTML TO FILE 'temp/entity.txt'.
    
        END CASE.

    There's no check for XML. Add a WHEN with the appropriate XML and you should be good.

  • I found WHEN 'application/atom+xml' THEN

               COPY-LOB lcHTML TO FILE 'temp/entity.xml'.

    many thanks.

  • You can also use the MimeTypeHelper
     
     
    if OpenEdge.Net.MimeTypeHelper:IsXML(oResponse:ContentType) then
           copy-lob lcHTML to file 'temp/entity.xml'.
     
    which will do the right thing for other XML types too.
     
     
  • Thanks Peter work fine.

    I add in the code:

    oCredentials = new Credentials('application', 'amministratore', 'Its@55!').

    oRequest = RequestBuilder:Get('obsv:5493/.../Clients')

                   :AcceptJson()

                   :UsingBasicAuthentication(oCredentials)

                   :Request.

    But OE do not create an XML file but entity.txt with contains different data format as application/octet-stream.

    I have to pass only user and password.

    Thx.

  • Hi Peter,

    resolved with these lines:

    // Create credentials

    oCredentials  = new Credentials('some-domain', 'amministratore', '123456').

    oRequest = RequestBuilder:Get('obsv:5493/.../ClientDocuments')

           // Add credentials to the request

           :UsingBasicAuthentication(oCredentials)

           :Request.

    This work fine. Now I have to PUT data into. DO you have some suggestion to give me?

    Thx.