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
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