Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / June 2004

Tip: Looking for answers? Try searching our database.

Passing Binary Data causes Error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jon Turner - 22 Jun 2004 19:40 GMT
The following is happening when I transfer binary (PCL) data.   When
changing the
PCL to simple text, everything transfers fine.  Is there a special
requirement when
transferring Binary Data like this via a string ?  Many Thanks

1.  I have a IIS Hosted remoting object that passes back a PCL Stream to the
client via a String.  (e.g. CreateCheckPCLStream(ByRef sStream as String).

2.  When calling this routine remotely, I am getting the following XML
Error:
   An unhandled exception of type 'System.Xml.XmlException' occurred in
       mscorlib.dll               Additional information: System error.

3.  My  web.config file looks like this:

<system.runtime.remoting>
   <application>
       <service>
           <wellknown mode="SingleCall"
               objectUri="CheckPrintServicesFBOD.rem"
               type="LTSWebChecks.CheckPrintServicesFBOD, LTSWebChecks" />
       </service>
       <channels>
           <channel ref="http">
               <serverProviders>
                   <provider ref="wsdl" />
                   <formatter ref="soap" typeFilterLevel="Full" />
                   <formatter ref="binary" typeFilterLevel="Full" />
               </serverProviders>
           </channel>
        </channels>
   </application>
</system.runtime.remoting
Sunny - 23 Jun 2004 15:08 GMT
Hi,
I'm not sure, but you will have problems even without remoting.

When you call (ByRef sStream as String) reference to what you provide?
What happens is that sStream is converted to string, and then the
reference to that string is provided. And if there are changes over that
string, where are they returned? How do they are reflected to the
stream?

Either convert the stream to string before you make the invocation, or
pass the string as itself.

Also, why do you need 2 formatters?

Sunny

> The following is happening when I transfer binary (PCL) data.   When
> changing the
[quoted text clipped - 30 lines]
>     </application>
> </system.runtime.remoting
Jon Turner - 23 Jun 2004 15:30 GMT
The question is when my string contains binary data, why am I getting
an XML error.  and when it contains only text, I do not get any errors:

An unhandled exception of type 'System.Xml.XmlException' occurred in
>         mscorlib.dll               Additional information: System error.

> Hi,
> I'm not sure, but you will have problems even without remoting.
[quoted text clipped - 46 lines]
> >     </application>
> > </system.runtime.remoting
Sunny - 23 Jun 2004 16:27 GMT
Hi,

> The question is when my string contains binary data, why am I getting
> an XML error.  and when it contains only text, I do not get any errors:
>
> An unhandled exception of type 'System.Xml.XmlException' occurred in
> >         mscorlib.dll               Additional information: System error.

Please, post the declaration of PCLStream class, which class does it
inherit?

As a general, you should pass binary data as byte array, not as string.

Sunny
Jon Turner - 23 Jun 2004 16:49 GMT
Thanks sunny, I converted PCLStream from a string to a Byte Array and it
works fine.  Just don't understand why the binary formatter didn't do the
trick.

> Hi,
>
[quoted text clipped - 10 lines]
>
> Sunny
Sunny - 23 Jun 2004 17:27 GMT
Hi,

you have setup both soap and binary formatter. I guess that the soap
formatter takes precedence, thus trying to put a pure binary data in the
XML which it passes.

You may try to remove the soap formatter as well, and see what happens.
But still there may be some complications with the binary formatter, as
it expects in the string to have unicode text and will try to
encode/decode it accordingly.

Sunny

> Thanks sunny, I converted PCLStream from a string to a Byte Array and it
> works fine.  Just don't understand why the binary formatter didn't do the
[quoted text clipped - 15 lines]
> >
> > Sunny

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.