read/write binary file

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default read/write binary file

    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.

    Stephen Richardson Guest

  2. Similar Questions and Discussions

    1. Unable to read/write to .ini file using .dll in webservice
      Hi, I am new to asp.net. I am creating a web service. This I havedone. The web service calls one of our .dll's. This .dll usesthe...
    2. File system get auto change from read-write to read-oly
      I have a very strange file system with OS Redhat 7.2 The file system is read-write, but some how it randomly changes to read-only at any time....
    3. fopen to read binary file (jpg, pdf, etc.)
      I have a PHP script that would read in a binary file and display it as if it were <img src>, how would you do that w/o changing the header's MIME...
    4. Read/Write IO on socket file descriptor
      Hi all, I'm trying to perform read and write I/O on a socket file descriptor received for another process via a Unix Domain Socket. In trying to...
    5. Read and write binary data by using ADO
      I use ADO (AppendChunk) in a C++ program to write binary data file into a table column of type image. The image files have almost the size of 1...
  3. #2

    Default Re: read/write binary file

    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 [url]http://www.MIND.com.my[/url]

    "Stephen Richardson" <srichardson@mazak.co.uk> wrote in message
    news:0c4301c360b7$14af2490$a301280a@phx.gbl...
    > 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.
    >

    Erymuzuan Mustapa Guest

  4. #3

    Default Re: read/write binary file

    Hi,
    > 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:
    [url]http://www.nesterovsky-bros.com[/url]




    Arthur Nesterovsky Guest

  5. #4

    Default RE: read/write binary file

    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 [url]http://msdn.microsoft.com/msdnmag/issues/02/12/DIME/default.aspx[/url]. 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"
    [url]http://msdn.microsoft.com/webservices/building/wse/default.aspx?pull=/library/en-us/dnwebsrv/html/dimewsattch.asp[/url]

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

    Hope that helps.

    Best regards,
    Yanhong Huang
    Microsoft Online Partner Support

    Get Secure! - [url]www.microsoft.com/security[/url]
    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@mazak.co.uk>
    !Sender: "Stephen Richardson" <srichardson@mazak.co.uk>
    !References: <0c4301c360b7$14af2490$a301280a@phx.gbl>
    !Subject: read/write binary file
    !Date: Tue, 12 Aug 2003 03:06:24 -0700
    !Lines: 17
    !Message-ID: <0c7701c360b9$6367d030$a301280a@phx.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.
    !>
    !>.
    !>
    !


    Yan-Hong Huang[MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139