Posts Tagged ‘Progress OpenEdge’
How to Make HTTP Calls in Progress OpenEdge 10.2A
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.
How to Call SOAP Web Services in Progress OpenEdge 10.2A
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.
Progress OpenEdge Apache Camel Component
Just submitted in CAMEL-1734.
SOAP Fault Handling in Java, .NET and Progress OpenEdge
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.
AppServer vs. AppServerDC
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”.
Issue with Progress OpenEdge Java Open Client 10.1C03 on Java 5+
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.
How to OSGi-fy Progress OpenEdge Java Open Client
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
Undocumented Configuration of the Progress OpenEdge Adapter for Sonic
com.progress.openedge.homecan be replaced bycom.sonicsw.xq.home.com.progress.openedge.logLevelcan be used to configure the log level (1-5).
OpenEdge Development: 10.2A Java Open Clients
Whenever the ESB adapter doesn’t cut it.
http://communities.progress.com/pcom/servlet/JiveServlet/download/16333-2-15466/dvjav.pdf
SpringSource Acquires Hyperic to Unify Developer to Datacenter Application Lifecycle
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.