Software

How to Change the Log Level of upic-openedge in Apache ServiceMix

1) Add the following line to <Install Dir>/etc/org.ops4j.pax.logging.cfg:

log4j.category.upic-openedge=WARN

2) Restart the ESB.

You can find the component here.

Software

How to Call a SOAP Service with Progress OpenEdge

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 'https://simplesassim.wordpress.com/openedge/SampleService?WSDL'").

RUN SamplePortType SET hPort ON hServ.

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

hDocReq:SET-ATTRIBUTE("xmlns", "https://simplesassim.wordpress.com/openedge").

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.
Software

Progress OpenEdge AppServer Session Models

Session-Managed

The AppServer maintains context between requests for each client that it services, and each such clientparticipates in a persistent connection to the AppServer.

The connected AppServer is dedicated to serving that one client until the connection between them is terminated.

In this session model, all client requests are single-threaded, meaning that the AppServer does not handle another request from the same client until it has completed and responded to any pending request from that client.

Session-Free

The AppServer maintains no context for any client that it services.

Requests from a session-free client are handled by any available AppServer (and AppServer agent) that supports the required application service.

Thus, a session-free AppServer executes requests from all clients as it receives them, and completes each request independently of any prior request.

In this session model, all requests from a client are multi-threaded, meaning that multiple requests from a single client can be executed in parallel, as AppServer resources permit.

Refer to page 1-13 of the OpenEdge Application Server: Developing AppServer Applications guide for details.

Software

How to Make a HTTP Call with 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://host -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.
Software

How to Handle a SOAP Fault

Java

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

public class SOAPSample {

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

    try {
      ...
    } catch (final SOAPFaultException e) {
      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

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

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

  }

}

.NET

using System.Web.Services.Protocols.SoapException;

public 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.

W/o 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.