Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. Stream Problem in WCF

Stream Problem in WCF

Scheduled Pinned Locked Moved WCF and WF
helpcsharpwcftestingbeta-testing
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cdpace
    wrote on last edited by
    #1

    Hello guys, Today guys at work i wanted to do a method in my WCF service that accepts a Stream which is going to be used to transfer a file from my client application trough WCf. After coding this everything worked fine i manged to make everything work and i started testing. When i tried the method with a file that was of 24kb of size everything worked correctly but the problems started when i tested with a file of size 64kb. Whenever i choose this file it kept giving me the following error "Bad Request(404)..." something like that can't remember the full error code at the moment. I tried to set the maximumReciveBuffer size and other sizes at the endpoint but still nothing it kep crashing when i gave it large file sizes. Any idea guys really need some help with this im kinda stuck tried searchin google but cant find an answer that i can understand. Thank you in advance Regards, Christian Pace

    M 1 Reply Last reply
    0
    • C cdpace

      Hello guys, Today guys at work i wanted to do a method in my WCF service that accepts a Stream which is going to be used to transfer a file from my client application trough WCf. After coding this everything worked fine i manged to make everything work and i started testing. When i tried the method with a file that was of 24kb of size everything worked correctly but the problems started when i tested with a file of size 64kb. Whenever i choose this file it kept giving me the following error "Bad Request(404)..." something like that can't remember the full error code at the moment. I tried to set the maximumReciveBuffer size and other sizes at the endpoint but still nothing it kep crashing when i gave it large file sizes. Any idea guys really need some help with this im kinda stuck tried searchin google but cant find an answer that i can understand. Thank you in advance Regards, Christian Pace

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      You've done everything described here? How to: Enable Streaming[^]

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      C 1 Reply Last reply
      0
      • M Mark Salsbery

        You've done everything described here? How to: Enable Streaming[^]

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        C Offline
        C Offline
        cdpace
        wrote on last edited by
        #3

        Yes but i didn't understand this part. Do I have to specify all of these methods in the Contract?

        [OperationContract]
        Stream GetStream(string data);
        [OperationContract]
        bool UploadStream(Stream stream);
        [OperationContract]
        Stream EchoStream(Stream stream);
        [OperationContract]
        Stream GetReversedStream();

        In my case i just created one method that accepts a System.IO.Stream. The Stream works fine my problem arises when i am specifying a file that is of size 64Kb when i specified a file of 24Kb it worked just fine.

        M 1 Reply Last reply
        0
        • C cdpace

          Yes but i didn't understand this part. Do I have to specify all of these methods in the Contract?

          [OperationContract]
          Stream GetStream(string data);
          [OperationContract]
          bool UploadStream(Stream stream);
          [OperationContract]
          Stream EchoStream(Stream stream);
          [OperationContract]
          Stream GetReversedStream();

          In my case i just created one method that accepts a System.IO.Stream. The Stream works fine my problem arises when i am specifying a file that is of size 64Kb when i specified a file of 24Kb it worked just fine.

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          cdpace wrote:

          Do I have to specify all of these methods in the Contract?

          No - that's an example of four different ways you could do it. You just need to satisfy the requirements listed above that example. I would recommend using streamed transfer mode instead of buffered transfer mode, unless the files are always going to be small. I know it works, so maybe create a sample service from scratch following the steps outlined in the docs. Then maybe you'll see what's different on your service configuration.

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups