RemObjects Server not downwards compatible for non-RemObjects clients that worked with 8.x


(Henk Post) #1

I had some non RemObject clients on a RemObjects server (version 8.x). Today, I updated that server to and those clients could not get any expected response.

It took me some while to find out that the following lines in uROHTTPBaseServer were changed in the 9.x series. And I just wonder why?

procedure TROBaseHTTPServer.ProcessRequest(const aTransport: IROHTTPTransportEx;
  const aRequestStream: TStream; out aResponseStream: TROBinaryMemoryStream;
  const aResponse: IROHTTPResponse);
(many unchanged lines of code)
      ok := false;
      ParsePathInfo(aTransport.PathInfo, lroot,lSubPath);

      if lSubPath = '' then
        lpath2 := lroot
        lpath2 := lroot+'/'+lSubPath;

//INSTEAD of the lpath2 parameter below, in 8.x this was lroot
      ldisp := TROHTTPMessageDispatchers(Dispatchers).GetDispatcherByPath(lpath2) as TROHTTPDispatcher;

(some more unchanged code)

My question is, for what purpose is this part of the code changed? Did it solve other situations?

Since I have many external parties accessing my ‘old’ RemObjects servers I patched this part to work like the 8.x versions. But probably this patch is not a good idea. But I don’t know, since there might be some good reasons for altering this part of the code? I’m just very curious…

(EvgenyK) #2

it was a fix for issue described in Base URL for an RO Server

(Henk Post) #3

Yesterday and today I was still struggling with this piece of code. I have some ‘old’ non-remobjects clients that were able to communicate with a RemObjects 8.3 server, but not with 9.3 or 9.4

However, I think that the fix mentioned above (Base URL for an RO Server) is the way to go and hence, I implemented a CustomResponseEvent. But for that I basically copied the example. And then, in that example there was no clone of the ROMessage like was mentioned in Using OnCustomResponseEvent in a ROSDK Server.

Hence I now used the following code that seems to solve my issue:

procedure TDmROServer.ROServerCustomResponseEvent(const aTransport: IROHTTPTransport; const aRequestStream,
  aResponseStream: TStream; const aResponse: IROHTTPResponse; var aHandled: Boolean);
  op: TROResponseOptions;
  lMessage:  IROMessage;
  if AnsiMatchText(aTransport.PathInfo, ['/soap/IMyService1', '/soap/IMyService2']) then
    lMessage:= (ROSOAPMessage1 as IROMessageCloneable).Clone; //This one I originally forgot.
    MainProcessMessage(lMessage, aTransport, aRequestStream, aResponseStream, op);
    aHandled := True;

I just added this response since it might help others struggling with old clients that are not compatible anymore to RemObjects 9.x servers.