Faxing PDF using Web Service (C#)

Home Forums FaxFinder Faxing PDF using Web Service (C#)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4740
    Marshal Stephen
    Participant

    Hi, so I am trying to use the web service to fax PDF documents. I looked at the sample code provided here. I’m using the schedule.xml file provided. I am getting an error closing the request stream:

    Stream dataStream = request.GetRequestStream();
    dataStream.Write(byteArray, 0, byteArray.Length);
    dataStream.Close(); //Error received “Cannot close stream until all bytes are written”

    Here’s what I am doing: I am opening this schedule.xml, in the <attachment> section, I am replacing the sample <content> tag with my content (which is the base 64 encoded string from my PDF document).

    Now the sample code runs fine by itself. Once I swap it out with my the base 64 encoded string of my PDF, the error happens.

    Any help, suggestions would be greatly appreciated!

    #4741
    Victor Camacho
    Participant

    Hi Marshal,

    Did you check that the file size (len) changed?

    Sounds like write is waiting for more bytes.

    Just a thought and good luck,
    Victor
    (Just stopped by to check on my thread.)

    #4761
    Marshal Stephen
    Participant

    Hi Victor, thank you for checking out my post; sorry I was on vacation. It seemed to go through now. It is weird. I noticed the xml file had the root tags <xml….>. It must have happened when I opened and saved with an xml editor. I removed it and it seems to go through. Though, the exception was very much misleading.
    Now to post another question on how to find out if the fax did indeed go through so I can update my db records accordingly!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘FaxFinder’ is closed to new topics and replies.