Base URL for an RO Server

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

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;

Thank you for the help. That works well.

  • Joe

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

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.

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