Re: Requested Service not found
- From: "Chris Yager" <chris.yager@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 11 Dec 2005 19:30:33 -0600
The first thing I notice is you are using a binary formatter on the server
but you are not specifying a formatter on the client. The client really
determines the mode of communication and when using an http channel, the
default formatter is soap. I believe on the server that the soap formatter
is available even if you don't specify it so I don't know that it will
prevent your example from working but just to be consistent, you may want to
specify the binary formatter on the client or use the default soap formatter
on the server.
The other thing I noticed was the use of Hello.REM for the objectUri on the
server. I know that when using the soap formatter in IIS you must use
either .soap or .rem but I don't know if it is case sensitive so you might
try using Hello.rem instead of Hello.REM.
If you still have trouble, set your client side url to [full type name].soap
and try that. If the remoting configuration doesn't like your objectUri
setting, it will expose the object as [type].soap. For example:
"HeloWorldIIS.Hello.soap".
-chris
"larry" <laurence.chang@xxxxxxxxxx> wrote in message
news:uKp1BwC$FHA.2156@xxxxxxxxxxxxxxxxxxxxxxx
> I'm trying to host a small remoting object on IIS, I tried several days,
> I can not get it work, So please help me, I really appreciate your help.
>
> Follwing is my code:
> -------------------------------------------------------
> //Remoting object code
> -------------------------
> using System;
>
> namespace HelloWorldIIS
> {
> /// <summary>
> /// Summary description for Class1.
> /// </summary>
> public class Hello:MarshalByRefObject
> {
> public Hello()
> {
>
> }
>
> public string HelloWorld()
> {
> return "Hello World";
> }
> }
> }
> ----------------------------------------------------------
> Web.Config
> ------------------------
> <configuration>
> <system.runtime.remoting>
> <application>
> <channels>
> <channel ref="http">
> <serverProviders>
> <formatter ref="binary" typeFilterLevel="Full" />
> </serverProviders>
> </channel>
> </channels>
> <service>
> <Wellknown
> mode="Singleton"
> type="HelloWorldIIS.Hello, HelloWorldIIS"
> objectUri="Hello.REM"
> />
> </service>
> </application>
> </system.runtime.remoting>
> </configuration>
>
> -----------------------------------------------------------
> IIS virtual directory is "HelloWorldIIS", I copied web.config to the
> virtual directory, and Remoting object assembly to virtual
> directory\bin\
>
> ---------------------------------------------------------------
> Client side code is just a win form with a single button to call
> the remoting object's function
> ------------------
> private void button1_Click(object sender, System.EventArgs e)
> {
> HttpChannel c = new HttpChannel();
> ChannelServices.RegisterChannel (c);
>
> Hello h =
> (Hello)Activator.GetObject(typeof(Hello),"http://localhost/HelloWorldIIS
> /Hello.REM", WellKnownObjectMode.Singleton);
> MessageBox.Show(h.HelloWorld());
>
> }
>
>
>
>
> _-----------------------------------------
> I tried to change objectUri diffrent way such as objectUri="Hello.SOAP"
> , seem thing happened.
>
>
>
> Larry
>
>
> Larry
>
> --
> Sent via .NET Newsgroups
> http://www.dotnetnewsgroups.com
.
- Follow-Ups:
- Re: Requested Service not found
- From: laurence chang
- Re: Requested Service not found
- References:
- Help: Requested Service not found
- From: larry
- Help: Requested Service not found
- Prev by Date: Re: Host a web service in a Windows Forms Application
- Next by Date: Re: Windows Service host on .NET 2.0
- Previous by thread: Help: Requested Service not found
- Next by thread: Re: Requested Service not found
- Index(es):