New Posts New Posts RSS Feed: "Unable to connect"  and "Binary stream does not contain a valid BinaryHeader" messages
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

"Unable to connect" and "Binary stream does not contain a valid BinaryHeader" messages

 Post Reply Post Reply
Author
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Topic: "Unable to connect" and "Binary stream does not contain a valid BinaryHeader" messages
    Posted: 15-Jan-2009 at 8:25am
Unfortunately, there is a well-known bug in Microsoft's implementation of .NET Remoting where
The client side channel was unable to interpret certain types of failures (such as timeouts) and so was passing the resulting text or HTML to the BinaryFormatter who attempted to interpret the text as though it were a binary encoded message. This resulted in a weird SerializationException about formatter version mismatches”.

 For more details see:

http://www.dotnetconsult.co.uk/weblog/PermaLink.aspx/827189d3-ee0e-444f-b01d-bf9ce9f70f5c

Fortunately, experience has shown us that over 90% of the time that customers receive this message  is caused by their not configuring the web.config file correctly for NAT. I suspect that this is what your problem is.  For more details read about NAT in Chapter 11 on Deployment in the DevForce Classic Developer's Guide.  For additional help, become a customer and send a support request to support@ideablade.com

 

Back to Top
rparas View Drop Down
Newbie
Newbie


Joined: 06-Jan-2009
Posts: 4
Post Options Post Options   Quote rparas Quote  Post ReplyReply Direct Link To This Post Posted: 14-Jan-2009 at 10:15pm
Hi. I'm also getting the same error. I tried doing what you've posted and i'm still getting this error. I really need your help. Thanks!
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 04-Oct-2007 at 12:27pm
It’s a NAT (Network Address Translation) problem most of the time.
 
 
Here is the detailed information from the Troubleshooting section of Chapter 11.  on Deployment from the "Developer Guide".
 

      IIS n-Tier Deployment

This section concentrates on issues that arise while deploying to an IIS n-tier environment.

IIS is notorious for the variety of maddening deployment melt-downs that are traced to subtle configuration mistakes. IIS messages are rarely helpful. Time to put on your deerstalker cap and Inverness cape and make like Sherlock Holmes.

     Binary stream ‘50’ does not contain a valid header.

You started the client application and you got the message.

 “Binary stream ‘50’ does not contain a valid header. Possible causes are invalid stream or object version change between serialization and deserialization.”

There are many possible causes but the most likely is a misconfigured Web.config file. Let’s wade through the debugging steps.

đ      Confirm that TestAsa.aspx runs successfully.

You now know that the IIS directory is behaving like a virtual directory should and that you can reach the server website over the internet.

đ      Examine the server debug log.

If it exists, your client was able to awaken the DevForce BOS on the server. You would expect as much if the TestAsa ran well.

Suspect the Web.config file

Does the debug log stops after about eight lines and just before the first real interaction between client and server?

This is strong indicator that there is something wrong with the “Web.config” file.

It’s a NAT (Network Address Translation) problem most of the time. We’re most likely to use NAT if our server is behind a firewall.

When using NAT, we must specify the machine name in the “channel” tag such as this one:

<channel ref="http" machineName="www.ideablade.com">

1)       Spelling and case in XML is critical. Note the capital ‘N’ in “machineName”.

2)       Use a DNS name for the machine, not an IP address.

Of course if we are not using NAT – e.g., the we’ve deployed to a local copy of IIS on our development machine -- then we cannot have a machine name and the channel tag must look like this.

<channel ref="http">

Multiple deployment environments – e.g., development, test, stage, and production – invite this kind of error because we are always making this small change as we deploy to each environment.

P    Check the Web.config right now!

Don’t be like the author and “swear” it’s the right web.config without checking it. I’ve been embarrassed more than once by making this my last stop after a few hours of checking every other cause.

Mis-matched Assemblies

If the server entered the LoginManager but the application died while accessing a business object, it is could be a mismatched assembly.

One of the server assemblies – most likely your business object model dll – is not the same on both client and server. It may look the same – it may have the same version number – but it is different.

Confirm that each server-side assembly (dll) matches its corresponding client-side assembly exactly.
Back to Top
parvesh View Drop Down
Newbie
Newbie


Joined: 02-Sep-2007
Posts: 3
Post Options Post Options   Quote parvesh Quote  Post ReplyReply Direct Link To This Post Posted: 04-Oct-2007 at 4:16am
1. My virtual directory is setup for .Net 2.0
2. Well known type is already set to IdeaBlade.Persistence.RemotingPersistenceServicedeaBlade.Persistence.RemotingPersistenceService
3. Client & Server settings are ok, as the application is working fine for development mode.
4. Global.asax is deployed.
5. permissions given on log folder.

Still I am getting Unable to Connect & Binary Stream Errors. & no log is present in the log folder.

Please help me out.

Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jul-2007 at 2:40pm
"The first problem that I have is that I can not run the DevForce kit, because there is no Visual Studio installed there."
Firstly you should create a Web Setup Project for your application (see Deploying Microsoft IIS section in Developers Guide – around page 455).  With that, you can create a msi install project that includes all required IdeaBlade DevForce assemblies.  So, you don’t have to install Visual Studio or IdeaBlade DevForce complete package.  It will greatly simplify your server deployment. 
 

"Then, I installed in IIS the application server.                                             I did all the configuration and I tested with Testasa.aspx... no error, but the first interesting thing is that the DebugLog.xml file is not generated."   Usually, there are 2 reasons – 1. Didn’t include the Global.asax file that directs to the ‘log’ directory.  2. The security settings of this ‘log’ folder must be setup properly.  In any case, see ‘Using Loose IdeaBlade.ibconfig for BOS’ section in page 457.  It will explain how to use a loose IdeaBlade.ibconfig file in this ‘log’ folder and also enable DebugLog.xml there. 

"After that, I configured the client application to remotely connect to the server (it's working on my testing environment, so the configurations are correct).                                                                                                            Starting the client, I recieve the message:                                         “Unable to connect to http://WCEYPT01:80/YPSServer/PersistenceServer.rem.  The server or internet connection may be down.”

There are several possibly reasons:

  1. Check if your application’s IIS virtual directory is setup for .NET 2.0 – see detail in page 456.
  2. There is a breaking change starting with DevForce version 3.4 – see IIS Deployments Breaking Changes section for version 3.4 in the Release Notes document.  The <wellknown> type attribute in the web.config file must be changed to “IdeaBlade.Persistence.RemotingPersistenceService”.
  3. Double check both the client and server side IdeaBlade.ibconfig files’ settings. 

 

Back to Top
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jul-2007 at 2:26pm

I tried to install our application developed with DevForce on a new server. We’re using the architecture with the application server hosted in IIS.

After that, I manually installed the IdeaBlade dlls on that server and the client application is running (connecting directly to the database).

Then, I installed in IIS the application server.

I did all the configuration and I tested with Testasa.aspx… no error, but the first interesting thing is that the DebugLog.xml file is not generated.

After that, I configured the client application to remotely connect to the server (it’s working on my testing environment, so the configurations are correct). 

Starting the client, I receive the message: 

“Unable to connect to http://WCEYPT01:80/YPSServer/PersistenceServer.rem.  The server or internet connection may be down.”

After that, when I’m trying to login, I have another error: 

“Binary stream '117' does not contain a valid BinaryHeader. Possible causes are invalid stream or object version change between serialization and deserialization.”

Please help me with some suggestions because I spent a lot of time trying to find out what could be the problem. Thanks

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down