How can I get the peer's IP when using IIS-hosted remoting with binary formatter and HTTP?

G

Guest

Hi!

I want to use
http://www.dotnetremoting.cc/Download/IPCheck.zip
together with an IIS-hosted remoting app.

The config-file for the standalone-application
that uses this provider looks like this:

<configuration>
<system.runtime.remoting>
<application>

<channels>
<channel ref="tcp" port="5555">
<serverProviders>
<formatter ref="binary" />
<provider type="IPChecker.IPCheckerSinkProvider, IPChecker" />
</serverProviders>
</channel>
</channels>

<service>
<wellknown mode="Singleton" type="Server.TestSAO, Server"
objectUri="TestSAO.soap" />
</service>
</application>
</system.runtime.remoting>
</configuration>



what must be changed to use this together with IIS?
What lines must be written in the web.config file?

There's this "channel ref="tcp" port="5555">" stuff.
How will that work? Of course IIS can only offer HTTP,
but I think this line is not correctly with IIS because
it implies that I would be able to choose between HTTP
and TCP!

Has anybody found another way of getting the ip (when
hosting in IIS) without Ingo's provider-class? (in case
it would have to be rewritten to support IIS)

Many thanks in advance
 
P

Perry Deng

Generally, when hosting remoting object in IIS, the web.configure file
should have the contents as follows:

<configuration>
<system.runtime.remoting>
<application>

<service>
<wellknown mode="singlEcall" type="HelloWorldObject.Hello,
HelloWorldObject" objectUri="SimpleHelloWorld.soap" />
</service>

</application>
</system.runtime.remoting>
</configuration>

Regarding this custom sink with IIS issue, I am performing further research
and will paste here with my findings.

In the meantime, you can refer to the following articles for more
information on hosting remoting objects in IIS:

Remoting Example: Hosting in Internet Information Services (IIS)
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconremotingexamplehos
tinginiis.asp

HOW TO: Host a Remote Object in Microsoft Internet Information Services
http://support.microsoft.com/default.aspx?scid=KB;EN-US;312107

Best regards,
Perry Deng
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Many thanks for your answer.

The sample you referred to does not use IIS, but
hosts it directly instead.
What must be changed in the code of that sample to
make it work with IIS?
(Or is there a better way to get the IP-adress when
hosting inside IIS?)

Does ipcheck.zip really only work with TCP-channels?
I don't see that in the code.
It just uses a
object obj = requestHeaders["IPAddress"];
 
P

Perry Deng

Yes, the IPFiler sample is not hosted in IIS. It uses HTTP protocol in the
channel and check the IP address using
requestHeaders[CommonTransportKeys.IPAddress]. Thus to enable the IPFiler
works with IIS, the configuration needs to be changed as I described
previously by the code and the links. Ipcheck may work with HTTP and of
cause there are some modifications needed, such as config files in both the
client and server, and the code. Please refer to the IPFiler sample for
more needed modification.

Best regards,
Perry Deng
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top