HighTechTalks DotNet Forums  

read/write binary file

ASP.net Web Services microsoft.public.dotnet.framework.aspnet.webservices


Discuss read/write binary file in the ASP.net Web Services forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Stephen Richardson
 
Posts: n/a

Default read/write binary file - 08-12-2003 , 04:49 AM






I'm writing a web service which will return a string
containing the contents of a binary file (converted using
System.Convert.ToBase64String). When I pass the string to
a second web service to write the file I get an exception
error "Invalid character in Base64 string" when I try to
use System.Convert.FromBase64String. Any ideas why this
happens or suggestions about other ways to write this (I
thought about using DIME attachments) would be appreciated.


Reply With Quote
  #2  
Old   
Erymuzuan Mustapa
 
Posts: n/a

Default Re: read/write binary file - 08-12-2003 , 05:03 AM






doing the conversiot , you are running the risk of certain characters has no
XML representation, that's why you getting the error on your client, my
suggestion would be to use DIME / WS-attachment, it's alot easier to develop
and configure and it's designed for this kind of purpose

--
Erymuzuan Mustapa
Inter Virtual Sdn. Bhd.
See MIND at http://www.MIND.com.my

"Stephen Richardson" <srichardson (AT) mazak (DOT) co.uk> wrote

Quote:
I'm writing a web service which will return a string
containing the contents of a binary file (converted using
System.Convert.ToBase64String). When I pass the string to
a second web service to write the file I get an exception
error "Invalid character in Base64 string" when I try to
use System.Convert.FromBase64String. Any ideas why this
happens or suggestions about other ways to write this (I
thought about using DIME attachments) would be appreciated.




Reply With Quote
  #3  
Old   
Arthur Nesterovsky
 
Posts: n/a

Default Re: read/write binary file - 08-12-2003 , 06:34 AM



Hi,

Quote:
I've got it working now but I would like to know if anyone
has a sample app which uses DIME attachments.
Visit my page and read/download SCCBridge project.
There are samples (sources on C#) how to send and receive
DIME on the both client- and server-side.
______________________________
With best wishes, Arthur Nesterovsky
Please visit my home page:
http://www.nesterovsky-bros.com






Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default RE: read/write binary file - 08-13-2003 , 01:56 AM



Hello Stephen,

Thanks for posting in the group.

I suggest you read the article "Sending Files, Attachments, and SOAP Messages Via Direct Internet Message
Encapsulation" at http://msdn.microsoft.com/msdnmag/issues/02/12/DIME/default.aspx. In this article, the author explains
what DIME is and how it differs from MIME encapsulation. A detailed description of the message format and how it is parsed,
as well as working with SOAP and extending it with WSDL, is also included.

"Understanding DIME and WS-Attachments"
http://msdn.microsoft.com/webservices/building/wse/default.aspx?pull=/library/en-us/dnwebsrv/html/dimewsattch.asp

For samples, you could refer to http://www.codeproject.com/cs/webservices/dimewebcam.asp?target=dime.

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as a
convenience to you. Microsoft does not control these sites and has not tested any software or information found on these
sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or
information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions
you to make sure that you completely understand the risk before retrieving any software from the Internet.

--------------------
!Content-Class: urn:content-classes:message
!From: "Stephen Richardson" <srichardson (AT) mazak (DOT) co.uk>
!Sender: "Stephen Richardson" <srichardson (AT) mazak (DOT) co.uk>
!References: <0c4301c360b7$14af2490$a301280a (AT) phx (DOT) gbl>
!Subject: read/write binary file
!Date: Tue, 12 Aug 2003 03:06:24 -0700
!Lines: 17
!Message-ID: <0c7701c360b9$6367d030$a301280a (AT) phx (DOT) gbl>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Thread-Index: AcNguWNnEwMHX0dbQOa8Q+F4S3zzQA==
!Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
!Path: cpmsftngxa06.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet.webservic es:18737
!NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
!
!I've got it working now but I would like to know if anyone
!has a sample app which uses DIME attachments.
!Steve
!
!>-----Original Message-----
!>I'm writing a web service which will return a string
!>containing the contents of a binary file (converted using
!>System.Convert.ToBase64String). When I pass the string to
!>a second web service to write the file I get an exception
!>error "Invalid character in Base64 string" when I try to
!>use System.Convert.FromBase64String. Any ideas why this
!>happens or suggestions about other ways to write this (I
!>thought about using DIME attachments) would be
!appreciated.
!>
!>.
!>
!



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.