从Delphi Web服务中查找客户端IP和SOAP调用信息

时间:2022-01-03 09:52:28

I have a Delphi Web Server setup and running, publishing Web Services, and I want to know some stuff on the calls to the web services:

我有一个Delphi Web Server设置和运行,发布Web服务,我想知道一些关于Web服务调用的东西:

  • The IP address of the client who calls the web service.
  • 调用Web服务的客户端的IP地址。

  • Some SOAP information on the call, such as username and password.
  • 有关调用的一些SOAP信息,例如用户名和密码。

How can I get this information from within the service code? My class is inheriting from TSoapDataModule, so I figure there's a way to get that info through it. Still, I can't find how.

如何从服务代码中获取此信息?我的类继承自TSoapDataModule,所以我认为有一种方法可以通过它获取该信息。不过,我找不到怎么样。

TMyAppServerDataModule = class(TSoapDataModule, ITMyAppServerDataModule ,
            IAppServerSOAP, IAppServer, ITMySOAPWebService)
// ...my working components and methods... //
end;

2 个解决方案

#1


3  

You should be able to get a TWebRequest from the Request property of the TWebModule object you get from calling GetSOAPWebModule. TWebRequest will tell you lots of things about the request. Like RemoteAddr

您应该能够从调用GetSOAPWebModule获得的TWebModule对象的Request属性中获取TWebRequest。 TWebRequest会告诉你很多关于请求的事情。喜欢RemoteAddr

#2


0  

See GetSOAPWebModule.Request (uses WebBrokerSoap;).

请参阅GetSOAPWebModule.Request(使用WebBrokerSoap;)。

#1


3  

You should be able to get a TWebRequest from the Request property of the TWebModule object you get from calling GetSOAPWebModule. TWebRequest will tell you lots of things about the request. Like RemoteAddr

您应该能够从调用GetSOAPWebModule获得的TWebModule对象的Request属性中获取TWebRequest。 TWebRequest会告诉你很多关于请求的事情。喜欢RemoteAddr

#2


0  

See GetSOAPWebModule.Request (uses WebBrokerSoap;).

请参阅GetSOAPWebModule.Request(使用WebBrokerSoap;)。