Base URL for an RO Server

delphi
windows

(Joe) #1

Greetings,

I am working on a RO (IndyHTTP channel) multi-message Delphi server. I am looking for a way to control the URL the server monitors. I don’t want the default of http://localhost:8099/soap.

I want it to be http://localhost:8099/v1/soap.

If that is possible, I would appreciate any suggestions on how to accomplish it.

Thanks - Joe


RemObjects Server 9.3.105.1531 not downwards compatible for non-RemObjects clients that worked with 8.x
(EvgenyK) #2

You can use OnCustomResponseEvent.
example of using this event is shown in this code snippet

it can be like:

// ROSOAPMessage should be drop to form
// '/v1/soap' string shouldn't be registered in `ROIndyHTTPServer1.Dispatchers`
procedure TMegaDemoServerMainForm.ROIndyHTTPServer1CustomResponseEvent(const aTransport: IROHTTPTransport;
  const aRequestStream, aResponseStream: TStream; const aResponse: IROHTTPResponse; var aHandled: Boolean);
var
  op: TROResponseOptions;
begin
  if AnsiSameText(aTransport.PathInfo,'/v1/soap') then begin
    MainProcessMessage(ROSOAPMessage,atransport,aRequestStream,aResponseStream,op);
    aHandled := True;
  end;
end;

RemObjects Server 9.3.105.1531 not downwards compatible for non-RemObjects clients that worked with 8.x
(Joe) #3

Thank you for the help. That works well.

  • Joe

(marc hoffman) #4

Also, can’t you just set the Path property of the SoapMessage to whatever you want? /soap is merely the default, not hardcoded…


(Joe) #5

I like that suggestion better, but it doesn’t work. I set the Path Info to V1/SOAP for the SOAPMessage in the server’s message Dispatchers and removed the CustomResponseEvent handler. With that config, the server returns an Invalid Path error for all requests directed to V1/SOAP.


(marc hoffman) #6

That sounds like a bug. I’ll check with Eugene…