Simples Assim

Posts Tagged ‘Progress OpenEdge

How to Make HTTP Calls in Progress OpenEdge 10.2A

leave a comment »

DEF VAR hSkt AS HANDLE NO-UNDO.
DEF VAR cReq AS CHAR NO-UNDO.
DEF VAR mpReq AS MEMPTR NO-UNDO.

CREATE SOCKET hSkt.

hSkt:CONNECT("-H http://fernandoribeiro.eti.br/ -S 80") NO-ERROR.

cReq = "GET /~r~n".

SET-SIZE(mpReq) = LENGTH(cReq) + 1.

PUT-STRING(mpReq, 1) = cReq.

hSkt:WRITE(mpReq, 1, GET-SIZE(mpReq)) NO-ERROR.

hSkt:DISCONNECT() NO-ERROR.

DELETE OBJECT hSkt.

http://www.rfc-editor.org/rfc/rfc2616.txt

Thanks to Carlos, Miro and PH for the help.

Written by Fernando Ribeiro

August 25, 2009 at 12:31 am

Posted in Software

Tagged with

How to Call SOAP Web Services in Progress OpenEdge 10.2A

leave a comment »

DEF VAR hServ AS HANDLE.
DEF VAR hPort AS HANDLE.

DEF VAR hReq AS HANDLE.
DEF VAR hRes AS HANDLE.

DEF VAR hDocReq AS HANDLE.
DEF VAR hDocRes AS HANDLE.

DEF VAR lcReq AS LONGCHAR.
DEF VAR lcRes AS LONGCHAR.

DEF VAR i AS INT INITIAL 0.

CREATE SERVER hServ.

CREATE X-DOCUMENT hReq.
CREATE X-DOCUMENT hRes.

CREATE X-NODEREF hDocReq.
CREATE X-NODEREF hDocRes.

hServ:CONNECT("-WSDL 'http://fernandoribeiro.eti.br/SampleService?WSDL'").

RUN SamplePortType SET hPort ON hServ.

hReq:CREATE-NODE(hDocReq, "Sample", "ELEMENT").

hDocReq:SET-ATTRIBUTE("xmlns", "http://www.fernandoribeiro.eti.br/").

hReq:APPEND-CHILD(hDocReq).

hReq:SAVE("LONGCHAR", lcReq).

RUN Operation1 in hPort(INPUT lcReq, OUTPUT lcRes) NO-ERROR.

IF VALID-HANDLE(ERROR-STATUS:ERROR-OBJECT-DETAIL) THEN DO:
  MESSAGE ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-STRING VIEW-AS ALERT-BOX.
END.
ELSE DO:
  hRes:LOAD("LONGCHAR", lcRes, false).

  hRes:GET-DOCUMENT-ELEMENT(hDocRes).

  REPEAT i = 2 TO hDocRes:NUM-CHILDREN by 2:
    ...
  END.

END.

http://communities.progress.com/pcom/docs/DOC-16330

http://communities.progress.com/pcom/docs/DOC-1748

Thanks to PH for the help.

Written by Fernando Ribeiro

August 25, 2009 at 12:00 am

Posted in Software

Tagged with

Progress OpenEdge Apache Camel Component

with one comment

Just submitted in CAMEL-1734.

Written by Fernando Ribeiro

June 20, 2009 at 5:46 pm

SOAP Fault Handling in Java, .NET and Progress OpenEdge

leave a comment »

Java

import javax.xml.soap.SOAPElement;
import javax.xml.ws.soap.SOAPFaultException;

public final class SOAPSample {

  public static void main(final String[] args) {

    try {
      ...
    } catch (final SOAPFaultException e) {
      final SOAPElement detail = (SOAPElement) e.getFault().getDetail().getElementsByTagNameNS("urn:soap-fault:details", "FaultDetail").item(0); // replace by the actual detail, if any, this is for the Progress OpenEdge Adapter for Sonic ESB

      final SOAPElement msg = (SOAPElement) detail.getElementsByTagName("errorMessage").item(0);

      throw new Exception(msg.getValue(), e));
    }

  }

}

.NET

using System.Web.Services.Protocols.SoapException;

public sealed class SOAPSample {

  public static void main(const String[] args) {

    try {
      ...
    } catch (const SoapException Ex) {
      throw new Exception(Ex.Detail["FaultDetail", "urn:soap-fault:details"]["errorMessage"].InnerText); // replace by the actual detail, if any, this is for the Progress OpenEdge Adapter for Sonic ESB
    }

  }

}

Progress OpenEdge w/o Detail

...

IF VALID-HANDLE(ERROR-STATUS:ERROR-OBJECT-DETAIL) THEN
DO:
  RETURN ERROR ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-STRING.
END.

Progress OpenEdge w/ Detail

DEF VAR hFault AS HANDLE.
DEF VAR hDetail AS HANDLE.
DEF VAR hMsg AS HANDLE.

CREATE X-NODEREF hFault.
CREATE X-NODEREF hDetail.
CREATE X-NODEREF hMsg.

...

ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-DETAIL:GET-NODE(hFault).

IF VALID-HANDLE(hFault) THEN
DO:
  hFault:GET-CHILD(hDetail, 1).

  hDetail:GET-CHILD(hMsg, 1).

  RETURN ERROR hMsg:NODE-VALUE.
END.

Thanks to Luiz and Paulo for the help.

Written by Fernando Ribeiro

June 9, 2009 at 3:35 pm

Posted in Software

Tagged with ,

AppServer vs. AppServerDC

leave a comment »

As per the OpenEdge Application Server: Administration guide, AppServer uses name servers (AppServer://<host>:<name server port>/Broker), while AppServerDC doesn’t (AppServerDC://<host>:<broker port>).

DC stands for “Direct Connect”.

Written by Fernando Ribeiro

May 24, 2009 at 9:35 pm

Posted in Software

Tagged with

Issue with Progress OpenEdge Java Open Client 10.1C03 on Java 5+

with one comment

Because the setIntegerParameter(int, int, int) and setIntegerParameter(int, Integer, int) methods, among others, in the com.progress.open4gl.dynamicapi.ParameterSet class, are ambiguous, you need to resort to setParameter(int, Object, int, int, boolean, int).

You might want to use the constants for the Progress OpenEdge types in com.progress.open4gl.Parameter.

Written by Fernando Ribeiro

May 23, 2009 at 10:06 pm

Posted in Software

Tagged with

How to OSGi-fy Progress OpenEdge Java Open Client

leave a comment »

1) Create the o4glrt.bnd file:

Bundle-Version: <version as in the version file in o4glrt.jar>

The format is major( '.' minor ( '.' micro ( '.' qualifier )? )? )?, as per the page 28 of the spec. For 10.1B, it is 10.1.0.B.

2) Run Bnd:

java -jar <Bnd jar file> wrap -properties o4glrt.bnd o4glrt.jar

Written by Fernando Ribeiro

May 23, 2009 at 4:04 pm

Posted in Software

Tagged with ,

Undocumented Configuration of the Progress OpenEdge Adapter for Sonic

leave a comment »

  • com.progress.openedge.home can be replaced by com.sonicsw.xq.home.
  • com.progress.openedge.logLevel can be used to configure the log level (1-5).

Written by Fernando Ribeiro

May 18, 2009 at 2:18 am

Posted in Software

Tagged with ,

OpenEdge Development: 10.2A Java Open Clients

leave a comment »

Written by Fernando Ribeiro

May 16, 2009 at 3:12 pm

Posted in Software

Tagged with

SpringSource Acquires Hyperic to Unify Developer to Datacenter Application Lifecycle

leave a comment »

By accelerating and unifying the lifecycle from developer to data center and bridging the divide between development and IT operations teams, SpringSource can meet all the needs of companies building and deploying business-critical Java applications across datacenters, virtualized and cloud computing environments.

Can only hope they don’t fall in the same traps as Oracle.

FUSE HQ is based on Hyperic HQ Enterprise, but unlike it, doesn’t have an open source version. Unsure if that is ever going to be replaced by an Progress Actional product along with Progress OpenEdge Management.

http://www.hyperic.com/springsource/

Written by Fernando Ribeiro

May 10, 2009 at 12:48 am

Follow

Get every new post delivered to your Inbox.

Join 784 other followers