>>I'm stuck using this workaround, because I don't control the client.<<
Kinda the same problem here. The whole point of using a web service was
supposed to be to avoid the dll hell involved with distributing com objects
to hundreds of machines.
"Brad Quinn" <brad_quinn@yahoo.com> wrote in message
news:#X4avM3VDHA.2024@TK2MSFTNGP12.phx.gbl...[color=blue]
> I'm stuck using this workaround, because I don't control the client.
>
> Does your client have the .NET runtime installed? If it does, I would
> create a COM object using .NET (C#,
VB, whatever) to do the Base64[/color]
encoding[color=blue]
> in a way that is garaunteed to be compatible. You could then use the COM
> object from VB6.
>
> "Brad Quinn" <brad_quinn@yahoo.com> wrote in message
> news:eWwWVG3VDHA.2040@TK2MSFTNGP11.phx.gbl...[color=green]
> > I'm using a "legacy" (can't find the source) COM object to do base64
> > encoding and decoding. I was pretty sure that it was using Base64Encode[/color][/color]
/[color=blue][color=green]
> > Base64Decode from the ATL library.
> >
> > When I tried to decode using .NET I found out that the encodings were[/color][/color]
just[color=blue][color=green]
> > slightly incompatible. I was able to correct this with the following[/color]
> tweak;[color=green]
> >
> > int len = data.Length;
> > int excess = len % 4;
> > if ( excess != 0 ) {
> > if ( data.EndsWith( new string( '=', excess ) ) ) {
> > bw.Write( Convert.FromBase64String( data.Substring( 0, len -
> > excess ) ) );
> > } else {
> > throw new FormatException( "Base64 string length not a mutiple of[/color]
> 4" );[color=green]
> > }
> > } else {
> > bw.Write( Convert.FromBase64String( data ) );
> > }
> >
> > In my case, the "badly" encoded string had too much padding.
> >
> > Good Luck.
> >
> > "Al Knowles" <codefinger@cox.net> wrote in message
> > news:gawVa.27709$zd4.10821@lakeread02...[color=darkred]
> > > I have researched and tried every method I can find for passing a[/color][/color]
> two-page[color=green][color=darkred]
> > > tif file from a VB6 application to
> > > a web service via XML. These include XMLTextReader.ReadBase64,
> > > Convert.FromBase64, and using
> > > the Binary Writer. When the web service stores the file, the length[/color][/color][/color]
is[color=blue][color=green]
> > the[color=darkred]
> > > same as the uploaded length.
> > > Double-clicking on the file before it is uploaded will display it in[/color][/color][/color]
an[color=blue][color=green][color=darkred]
> > > image preview application.
> > > Double clicking on the newly uploaded file always returns an error[/color][/color][/color]
that[color=blue][color=green]
> > the[color=darkred]
> > > image format is not
> > > supported. (This is all local development).
> > >
> > > Does anyone have a tested example of uploading a two-page tif file[/color][/color][/color]
from[color=blue]
> a[color=green][color=darkred]
> > > VB6 application to a web service
> > > via XML? At this point I don't care how it is done, I just need[/color][/color]
> something[color=green][color=darkred]
> > > that works!
> > >
> > > Thanks in advance for any assistance you can provide.
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]