The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by jimhaley]

Fergal,
I'm trying to execute your remote object service example 5.7.6. I've followed
the steps you've provided but I get an error. I've posted it below under the
heading Error #1 Message. It basically is complaining that it can't find the
istringcoder dll file. I created the bin directory below the RemoteEncoder
directory and moved the two dll's to that bin directory. Is there something
I'm missing as far as how IIS recognizes the bin directory? When I move the
dlls back to the RemoteEncoder directory and execute the program, it
successfully finds the dll files but I get another error. Error #2 below
shows that error. It prints the original text but then I get a 405 - Method
not allowed error.

I'm running IIS5.1 on XP Pro. I've deinstalled/reinstalled IIS and applied
the service pack patch. Nothing I try seems to fix the problem. Am I missing
something fundamental? Is IIS on XP Pro stable? Do I need to do some
administrative procedures for security?

Thanks for your help.
Jim

ERROR #1 MESSAGE:
C:JimHaleymicrosoftcsharpchap5RemoteEncoder>base64client "Mary had a little
lamb"

Unhandled Exception: System.IO.FileNotFoundException: File or assembly name istr
ingencoder, or one of its dependencies, was not found.
File name: "istringencoder"
at RemoteEncoder.Base64Client.Main(String[] args)

Fusion log follows:
=== Pre-bind state information ===
LOG: DisplayName = istringencoder, Version=0.0.0.0, Culture=neutral, PublicKeyTo
ken=null
(Fully-specified)
LOG: Appbase = C:JimHaleymicrosoftcsharpchap5RemoteEncoder
LOG: Initial PrivatePath = NULL
Calling assembly : base64client, Version=0.0.0.0, Culture=neutral, PublicKeyToke
n=null.
===

LOG: Policy not being applied to reference at this time (private, custom, partia
l, or location-based assembly bind).
LOG: Post-policy reference: istringencoder, Version=0.0.0.0, Culture=neutral, Pu
blicKeyToken=null
LOG: Attempting download of new URL file:///C:/JimHaley/microsoft/csharp/chap5/R
emoteEncoder/istringencoder.DLL.
LOG: Attempting download of new URL file:///C:/JimHaley/microsoft/csharp/chap5/R
emoteEncoder/istringencoder/istringencoder.DLL.
LOG: Attempting download of new URL file:///C:/JimHaley/microsoft/csharp/chap5/R
emoteEncoder/istringencoder.EXE.
LOG: Attempting download of new URL file:///C:/JimHaley/microsoft/csharp/chap5/R
emoteEncoder/istringencoder/istringencoder.EXE.


C:JimHaleymicrosoftcsharpchap5RemoteEncoder>

ERROR #2 MESSAGE
C:JimHaleymicrosoftcsharpchap5RemoteEncoder>base64client "Mary had a little
lamb"
original : Mary had a little lamb

Unhandled Exception: System.Net.WebException: The remote server returned an erro
r: (405) Method Not Allowed.

Server stack trace:
at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessRespo
nseException(WebException webException, HttpWebResponse& response)
at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessMessa
ge(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransp
ortHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.SoapClientFormatterSink.SyncProcessMessag
e(IMessage msg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta, Int32 type)
at RemoteEncoder.IStringEncoder.Encode(String s)
at RemoteEncoder.Base64Client.Main(String[] args)

C:JimHaleymicrosoftcsharpchap5RemoteEncoder>
import-bot (20211) [Avatar] Offline
#2
Re: Remoting object service error
[Originally posted by fgrimes]

Hi Jim,

For client code "typeof(IStringEncoder)" to succeed, you need
istringencoder.dll in the client directory too. (It's just an interface
describing the remote service.)

Sorry... I could have explained this better in the book.

Regards,
Fergal
import-bot (20211) [Avatar] Offline
#3
Re: Remoting object service error
[Originally posted by jimhaley]

Thanks for the quick response.

With regard to your example in 5.7.6, I assume the client directory is the
RemoteEncoder directory. If that's the case, the result of my test is what
appears in message #2 from my original post. It prints the original line and
then give the following error (see message #2 for full message):

Unhandled Exception: System.Net.WebException: The remote server returned an erro
r: (405) Method Not Allowed.

Is there something in IIS I'm not configuring correctly? Is there a problem
with iis on xp pro?

Thanks,
Jim
import-bot (20211) [Avatar] Offline
#4
Re: Remoting object service error
[Originally posted by jimhaley]

Fergal,

I fixed the problem. Out of frustration, I reinstalled .net and .net
framework service pack 1 and that fixed the problem. Evidently, something was
amiss with the initial install. Sorry about the inconvenience. I do
appreciate your prompt help. You have created a technological masterpiece!

Thanks,
Jim
import-bot (20211) [Avatar] Offline
#5
Re: Remoting object service error
[Originally posted by fgrimes]

Hi Jim,

>> I reinstalled .net and .net framework service pack 1

That's a pain... but I'm glad it's working now.

>> You have created a technological masterpiece!

Now that would look good in an Amazon reader review smilie

Fergal